added rudimentary event hook