fix the flag initialization