var in nested function