update variables in template