debugged the delete action