fixing variables in templates