test before registering eventhandler