Event_handling
some fix to event handling