Fix a bug where the loaded modules do not load in the correct order