minor change in delete function