Added code for delete event