fixed small bug in freeing of new allocation