Fixed invalid event handler