fixed the problem that definitions from external references were not loaded properly