protected function runStack(array $stack, Request $request, Response $response)
    {
        $stack[] = function () use ($response) {
            $response->end();
        };

        $finalStack = array_merge($this->middlewares, $stack);
        $this->waterfall($finalStack, [$request, $response]);
    }