Correction in delete function