Adding a delete event handler