fixed prepare Modules function when no modules are defined