new event handler
Fixed event processing