fix deprecated variable access in template