templating bug fix