pre-delete script updated