Changed var counter line back to original, but in the new scope.