Fixed delete function error.