adding support for HTTP redirects