Small fix for event handling