fixed flag detection