fixed adding template variables via "as"