make sure an error is not lost
flatten import visitor so that variable imports can be processed at the end of a global queue