fixed a bug in InputManager