fix use of instance variable in template