modified deleteEvent logic