added template variable function