template handler another bug fix