fix auto fit n re-template