update variable in template