add a wrapper function for unregistering an event handler