Small fix in event handler