close template file