Please fix the local var name in the baseTag function (so that it does not shadow the outer variable), but do not move it up to the parent scope.