Modified delete events code