change discover_modules function