finalize eventhandler