Modified delete script