fix global var error lookup when undefined