Added support for following redirects