fixed confusing flag change