check the event type to prevent an exception