Changed delete function