fix the wrong modifierFlags checking logic