Should have had a try catch, instead check for the module being defined.