fix undefined variable reference