fix minor bugs on load_modules