added event handler to example