public function run($url = null, $method = null)
    {
        $request = new Request($method, $url);
        try {
//            foreach ($this->modules as $module) {
//
//            }

            Profiler::start('router');
            if ($match = $this->router->match($url, $method)) {
                if ($match['name'] === 'handleFilesystem') {
                    Profiler::stop('router');
                    return $this->handleFilesystem($match['params'], $request);
                } else {
                    $target = $match['target'];
                    $module = $target[0];
                    if ($module instanceof Module) {
                        if ($this->isEnabled($module->title)) {
                            $this->runningModule = $module;
                            $controller = $target[1];
                            $request->setParams($match['params']);
                            Profiler::stop('router');
                            return $module->run($controller, $request);
                        } else {
                            Profiler::stop('router');
                            return $this->mainModule->run(new ErrorController("This module is disabled by your 
                            policy"),
                                $request);
                        }
                    }
                }
            }
            Profiler::stop('router');


            return $this->mainModule->run(new ErrorController("Controller for '$url' not found. " .
                $this->getRoutes()),
                $request);
        } catch (\Exception $ex) {
            Events::dispatch('onException', $ex);
            return $this->mainModule->run(new ExceptionController($ex), $request);
        } catch (\Throwable $ex) {
            Events::dispatch('onError', $ex);
            return $this->mainModule->run(new ExceptionController($ex), $request);
        }
    }