add event handling