fixed flag issue