continued debugging of delete function
lets see if this works