more error checking for URL redirects