change flag order