fix use of undefined variable