fixed a bug about missing flag