bug fix in template variable