avoid exceptions leaving event-handler