ugly loop for getting rid of event handlers that are unbound