delete function been fixed up