add destroy function for events