initial code for event handling