Added support for redirects