added event firing, updated demo with example