updated to work with JQ 1.7+ using on(event), added event namespacing