public function executeHandler($request, $handler)
    {
        // execute actions as middleware
        if (!is_array($handler) || is_callable($handler)) {
            $handler = [$handler, \Bit55\Midcore\Middleware\NotFoundHandler::class];
        }
        $dispatcher = new Dispatcher($handler, $this->container);

        return $dispatcher->dispatch($request);
    }