fix the bug when changing the flag