removed use of local outside of function