adding custom event handler to the demo.