handle multiple events correctly
minor improvement
minor improvement event handler