fix bug in case there is a module cycle and an undefined variable is ref...

...erenced