fixing  variables on templates