minor fix in event handling