refactored catch statements on ModuleLoader