handling with flag problems