added more event processing