Move var to top of function.