use end event as well