change event handling to be correct