var scope, redefine var in nested function