removed use of undefined global var