deal with flag