delete function still having issues