debug delete function