getting event handling to work