* added error handling for redirects