delete script bug fix