debugging delete function