fix handling the redirectexception