handle redirects a little better