Made the EventHandler only take into account modifiers that are valid.