small change in delete function