Added the template variable to the new scope logic