fix flag order