public function getReturnUrl($defaultUrl = null)
    {
        $url = $this->app->session->get($this->returnUrlParam, $defaultUrl);
        if (is_array($url)) {
            if (isset($url[0])) {
                return $this->app->urlManager->createUrl($url);
            }

            $url = null;
        }

        return $url === null ? $this->app->urlManager->getHomeUrl() : $url;
    }