to debug delete function