added redirection exception handling