
    AUGUST, Respondent, v. BURNS, Appellant.
    
      (No. 6,080.)
    (Submitted March 24, 1927.
    Decided April 21, 1927.)
    [255 Pac. 737.]
    
      Parent and Child — Guardian and Ward — Habeas Corpus — ■ Collateral Attach — Bes Adjudicata — Attorney and Client— Evidence — Privileged Communications• — Exception to Buie ■ — Beformation of Instruments — Burden of Proof — Equity— Motion for Nonsuit Improper — Election of Bemedies.
    
    Habeas Corpus — Purpose of Writ.
    1. The purpose of a writ of habeas corpus is to determine the legality or illegality of the restraint alleged to be exercised; it is available only to persons unlawfully imprisoned or restrained of their liberty, and is independent of the legal proceeding under whieh the detention is sought to be justified.
    Same — Nature of Writ — Decision of Court Bes Adjudicata as to What.
    2. While a proceeding in habeas corpus involving the custody of a child is civil in its nature and the decision of the court awarding its custody is final, except for abuse of discretion, its decision is res adjudicata only as to those matters properly determined by it on the merits.
    Same — Minors—Appointment of Guardian — Order not Open to Collateral Attack.
    3. Where the return to a writ of habeas corpus directed to the guardian of a minor shows restraint under a valid appointment and qualification as guardian, it is legal so far as the writ is concerned, and the order of appointment is not open to collateral attack in such proceeding except for want of jurisdiction to make it.
    Same — -Election of Remedies — Unsuccessful Complainant not Barred from Pursuing Other Remedy.
    4. One mistakenly pursuing a remedy whieh he in fact had not and under whieh he received no relief is not thereby precluded from invoking the proper remedy; hence where a father in an effort to regain the custody of a minor child erroneously and unsuccessfully did so by way of writ of habeas corpus, he was not thereafter barred from bringing an action to revoke the letters of guardianship under whieh the child was being held.
    
      Judgments — Bes Adjudicata — Doctrine not Applicable to Decision of Motion.
    5. The doctrine of res adjudicata in the strict sense does not apply to the decision of a motion; therefore where a parent’s petition for the revocation of letters of guardianship over his child was on motion to quash dismissed as insufficient to warrant the relief demanded, the plea of res adjucRcata, was not available to defendant on the institution of a new action for the same purpose.
    
      1. See 12 R. C. L. 1184, 1187.
    2. See 12 R. C. L. 1255.
    
      Witnesses — Privileged Communications — Attorney Disqualified from Testifying to Knowledge Gained Through Conferences With Client.
    6. An attorney may not, under the provisions of section 10536, Revised Codes of 1921, as amended, relating to privileged communications, testify to matters of which he could have gained knowledge only through conferences with his elient, in a proceeding between that client and another arising out of such matters, in which he was no longer his former client’s attorney.
    Same — Privileged Communications — Attorney may Testify to Statement Made by Client Intended to be Communicated to Another.
    7. An attorney is not prohibited by section 10536, above (par. 6) from disclosing a statement made by his client with the express intention that it be communicated to another; hence the former attorney of defendant in a proceeding looking to the annulment of letters of guardianship was properly permitted to produce in court his office copy of a letter to plaintiff to show the purpose for which plaintiff’s consent to the appointment of the guardian was desired.
    Evidence — Departure from Pleading and Proof — Inadmissibility.
    8. Evidence not tending to establish any issue joined, but presenting a departure from pleading and proof, is inadmissible.
    Equity — Motion for Nonsuit Improper Practice.
    9. In an equity proceeding (guardianship matter) a motion for nonsuit is improper practice; in such a ease the entire evidence of both parties should be received to enable the supreme court on appeal to direct the entry of final judgment.
    Reformation of Instruments on Ground of Mistake — Burden of Proof.
    16. The party who seeks to revise or reform a written instrument on the ground of a mutual mistake of the parties, has the burden of establishing such mistake by clear, convincing and satisfactory evidence if he would overcome the presumption that the writing contains their final agreement and expresses their real purpose and intent.
    Same — Reformation of Order of Appointment of Guardian — Mistake—■ Evidence — Sufficiency.
    11. E'videnee in an action to have a guardianship of the person of a minor annulled on the ground that through the mistake of the attorney drawing plaintiff’s consent the guardianship included that of the 'person as well as the estate of the minor, whereas only the latter was intended, held sufficient to sustain plaintiff’s contention, and that the consent as given was due to a mutual mistake or through a mistake on the part of plaintiff which was known to or suspected by defendant guardian.
    Parent and Child — Welfare of Child Insufficient to Warrant Denial of Custody to Surviving Parent.
    12. While the welfare of a child in the matter of its custody is of paramount interest, neither sueh interest nor the child’s wish will justify a court in denying its custody to the surviving parent, in the absenee of a showing of unfitness or inability to support the child, and turning it over to a stranger.
    
      12. See 20 R. C. L. 601.
    
      
       Habeas Corpus, 29 C. J., sec. 1, p. 8, n. 17, 18; sec. 5, p. 12, n. 51; sec. 101, p. 109, n. 21; sec. 107, p. 112, n. 47; see. 108, p. 113, n. 56, 59, p. 114, n. 61, 62, 64. Judgments, 34 C. J., sec. 1282, p. 869, n. 56; sec. 1339, p. 935, n. 33.
    
       Election of Remedies, 20 C. J., see. 17, p. 23, n. 46.
    
       Judgments, 34 C. J., see. 1200, p. 781, n. 34. Motions, 28 Cyc., p. 20, n. 64.
    
       Witnesses, 40 Cyc., p. 2361, n. 81.
    
       Witnesses, 40 Cyc., p. 2376, n. 80.
    
       Guardian and Ward, 28 C. J., see. 75, p. 1087, n. 11 New.
    
       Equity, 21 C. J., see. 801, p. 634, n. 9. Guardian and Ward, 28 C. J., see. 75, p. 1087, n. 11 New. Trial, 38 Cyc., p. 1946, n. 46.
    
       Guardian and Ward, 28 C. J., see. 75, p. 1087, n. 11 New. Reformation of Instruments, 34 Cyc. p. 984, n. 34.
    
       Appeal and Error, 4 C. J., see. 2955, p. 975, n. 88. Reformation of Instruments, 34 Cyc., p. 984, n. 34.
    
       Parent and Child, 29 Cyc., p. 1587, n. 43, p. 1590, n. 55, p. 1597, n. 97.
    
      Appeal from District Court, Silver Bow County; George Bourquin, Judge.
    
    Petition by George August for modification or order appointing Bridget M. Burns guardian of tbe person and estate of Pauline Marie August, a minor. From decree revoking letters of guardianship, Bridget M. Burns, individually and as guardian, appeals.
    Affirmed.
    
      Mr. James H. Baldwin, for Appellants, submitted a brief and argued tbe cause orally.
    It is settled law in Montana that a litigant bas no right, as against tbe same adversary, to have a question, either of law or fact, relating to tbe same cause of action, twice adjudicated, in tbe same court or in another court of like jurisdiction, unless a re-examination of tbe question bas been regularly ordered, and an erroneous ruling is just as conclusive as tbe correct one, if allowed to become final. (In re Smith’s Estate, 60 Mont. 276, 199 Pac. 696.) This doctrine bas its foundation in two fundamental maxims of tbe law: “A man shall not be twice vexed for one and tbe same cause,” and “it is for tbe public good that there be an end to litigation.” (State 
      v. Hopkins, 68 Mont. 504, 219 Pao. 1106.) When these principles are applied to the facts alleged in the affirmative defense contained in the answer in this case, and admitted by the reply of the respondent here thereto, it appears clearly that the bar of res ad judicata had fallen and that the trial court erred in overruling appellants’ objection to the introduction of any evidence made at the commencement of the trial of the case.
    The principle of res adjudicata applies in habeas corpus proceedings of this nature, and the determination by the court of the issues presented is conclusive upon the same contestants. (Ex parte Turner, 86 Or. 590, 169 Pac. 109; Knapp v. Tolan, 26 N. D. 23, 142 N. W. 915; Wilkerson v. Galbreath, 107 Old. 227, 2'32 Pac. 21; In-re Clifford, 37 Wash. 460, 79 Pac. 1001; In re Hamilton, 66 Kan. 754, 71 Pae. 817; Freeman on Judgments, sec. 324; Church on Habeas Corpus, sec. 387; Willis, v. Willis, 165 Ind. 325, 2 L. R. A. (n. s.) 244, 248, 75 N. E. 655; Dawson v. Da/wson, 57 W. Va. 520, 100 Am. St. Rep. 800, 50 S. E. 613; In re Antonopulos, 171 App. Div. 659, 157 N. Y. Supp. 587; In re Bneeden, 105 Mich. 61, 62 N. W. 1009.)
    It has been definitely held in this state that habeas corpus is a special proceeding in the nature of a civil action and that the order finally disposing the same is a judgment. In State ex rel. Newell v. Newell, 13 Mont. 302, 34 Pac. 28; State ex rel. Brandege v. Clemmens, 52 Mont. 57, 155 Pac. 271, and in at least two cases this court has entertained an appeal from such an order or judgment (State ex rel. Newell v. Newell, 13 Mont. 302, 34 Pae. 28; State ex rel. Giroux v. Giroux, 15 Mont. 137, 38 Pac. 464; 19 Mont. 149, 47 Pac. 798). After one determination of a suit on the merits the controversy cannot be reopened to hear an additional reason, which before existed and was within the knowledge of the party, in support of the same cause of action. (2 Black on Judgments, 2d ed., sec. 731; Hennessy v. Chicago B. & Q. B. B. Co., 24 Wyo. 305, 157 Pac. 698; Ex parte Sill, 50 Cal. App. 45, 194 Pae. 510; 
      McKnighi v. Minneapolis etc. B. B. Go., 127 Minn. 207, L. R. A. 1916D, 164, 149 N. W. 131; Mazzarieilo v. Doherty, 204 Fed. 245, 122 C. C. A. 513; McCain v. Louisville & N. B. Go., 15 Ky. 80, 22 S. W. 325; Kimball v. Louisville & N. B. Go., 94 Miss. 396, 48 South. 230; Emerson y. Lewiston etc. By. Go., 116 Me. 761, 100 Atl. 3; Cotter y. Boston etc. By. Go., 190 Mass. 302, 76 N. E. 910; Greene v. Central Georgia By. Go., 112 Ga. 859, 38 S. E. 360; Cincinnati etc. By. Co. v. McKuire, 169 Ky. 711, 185 S. W. 93; Dunne y. Yund, 52 Mont. 24, 155 Pae. 273.)
    Respondent’s own showing demonstrates that there was no mistake of fact. A mistake of fact is a mistake not caused by neglect of a legal duty on the part of the person making the mistake, and consisting in: 1. An unconscious ignorance or forgetfulness of a fact, past or present, material to the contract; or, 2. Belief in the present existence of a thing material to the contract, which does not exist, or in the past existence of such a thing, which has not existed. (See. 7485, Rev. Codes 1921.)
    The proof in the case at bar fails utterly to show a case falling within the limits of this Code definition and shows affirmatively that if there was in fact a mistake on the part of the respondent here, it was a mistake caused by the neglect of a legal duty on his part, as well as to the legal effect and not as to the contents of the instrument he signed.
    The degree of carelessness which will prevent relief is stated in varying terms and depends largely upon the circumstances of the ease. (16 Cyc. 69.) The mistake to entitle one to relief must not be the consequence of his own culpable inertness. (Farrell v. Bouck, 60 Neb. 771, 84 N. W. 260.) “Or the consequence of wilful ignorance.” (Schaffner v. Schilling, 6 Mo. App. 42.) “Or his culpable negligence.” (Gompau v. Godfrey, 18 Mich. 27, 100 Am. Dec. 133.) “Or his gross negligence.” (Picot v. Page, 26 Mo. 398; Schaffner v. Schilling, supra.) “Or his carelessness or inattention.” (Wood v. Patterson, 4 Md, Ch. 335; Bobertson v. Smith, 11 Tex. 211, 60 Am. Dee. 234; Francis v. Parks, 55 Yt. 80.) “Or want of such diligence as might be fairly expected from a reasonable person.” (Kearney v. Sascer, 37 Md. 264.) “Or want of ordinary prudence or vigilance.” (Capehart v. Mhoon, 58 N. C. 178.) “Or want of due diligence.” (Lamb v. Harris, 8 Ga. 546; Thomas v. Bartow, 48 N. Y. 193.) “Or want of reasonable diligence.” (Keith v. Brewster, 114 Ga. 176, 39 S. E. 850; Brown v. Fagin, 71 Mo. 563.) “Or want of vigilance.” (Trippe v. Trippe, 29 Ala. 637.) Equity does not relieve against mistakes which ordinary care could have prevented. “Conscience, good faith and reasonable diligence are necessary to call a court of equity into activity.” (Bidder v. Car-ville, 101 Me. 59, 115 Am. St. Rep. 303, 63 Atl. 303; Biley v. Blacker, 51 Mont. 364, 152 Pac. 758.)
    It seems to be settled law in Montana that when it appears that a party claims to have been deceived to his prejudice, has investigated for himself, or that those means were at hand to ascertain the truth or falsity of any representation made to him, his reliance upon such representation, however false that may have been, affords no ground of complaint. (Helena Adjustment Co. v. Claflin, 75 Mont. 317, 324, 234 Pac. 1063; Moorehouse v. Northern Land Co., 68 Mont. 96, 216 Pac. 792; Grinrod v. Anglo-American Bond Co., 34 Mont. 169, 85 Pac. 891; McCormick v. Hubbell, 4 Mont. 87, 5 Pac. 314.) It definitely appears from the testimony of the respondent in this case that before signing the consent to and request for appointment of guardian the means were at hand to ascertain the truth or falsity of any representation made to him. He had the instrument in his hands and he also had an opportunity to examine it. If by his own negligence or carelessness he failed to do so, it is his own fault. If he was ignorant of the law on the subject, that does not excuse him. The result is that on the record here the trial court erred in failing to render judgment in appellants’ favor at the close of respondent’s case.
    
      In contests of this kind the opinion is now universal that neither of the parents has any right that can be allowed to militate against the welfare of the child, and in cases of this kind the paramount consideration is what is really demanded for its best interests. (Lally v. Fits Henry, 85' Iowa, 49, 16 L. R. A. 681, 51 N. W. 1155; Strudevant v. District Court, 15 Neb. 459 48 Am. Rep. 349 19 N. W. 617.)
    The cases supporting this view are tabulated in a note found on page 740 and following of Ann. Cas. 1914A, to which we invite the attention of the court. In this state the rule has been declared in at least three cases: Boles v. Boles, 60 Mont. 411, 199 Pac. 912; State v. District Court, 26 Mont. 433, 68 Pac. 797; State ex rel. Giroux v. Giroux, 15 Mont. 137, 38 Pac. 464.
    
      Mr. J. F. Sullivan and Mr. Joseph J. McCaffery, for Respondent, submitted a brief and argued the cause orally.
    Under the circumstances of this case, counsel who then represented respondents made a mistake in selecting the writ of habeas corpus as an efficient remedy to correct a mistake in a judgment rendered by the court, appointing the appellant the guardian of the person and estate of said minor. But one remedy was available, — that is a bill in equity for the modification of the judgment appointing the appellant the guardian of the person of said child; but a mistake having been made, does res ad judicata apply? We are of the opinion that the authorities are a unit in holding that the inappropriate use of an action or proceeding is not a bar to the employment of a suitable and appropriate remedy. (20 C. J., p. 21, sec. 17; O’Meara v. McDermott, 43 Mont. 189, 115 Pac. 912; Kaufman v. Cooper, 39 Mont. 146, 101 Pac. 969.) “Unsuccessful use of a remedy, supposed to be, but in effect not appropriate to vindicate the right of a particular matter, either because the facts turn out to be different from what plaintiff supposed them to be, or the law applicable to the facts is found to be other than supposed, though the first action proceeds to judgment, does not preclude plaintiff from thereafter invoking the proper remedy.” (Rowell v. Smith Adm., 123 Wis. 510, 102 N. W. 1.)
    There can be no bona fide claim that a statement or communication which is to be used in a pleading is of a confidential nature. “ Communication of matters which the attorney must necessarily, in the discharge of his duties, make public is not confidential, as the making of statements to be embodied in a pleading to be filed for client.” (10 Bncy. of Evidence, p. 236; Ruiz v. Dow, 113 Cal. 490, 45 Pac. 867; In re Elliott, 73 Kan. 151, 84 Pac. 750.)
    We submit that when the words “person” and “estate” were used as in the instrument signed by George August to a foreigner or even an average American citizen, there is much room for misconception — even the attorney who drew the instrument admitted under oath that he did not stop to analyze the meaning of what he termed a stock phrase, “guardian of the person and estate.” How, then, could the court hold the respondent responsible for a misconception of the meaning and extent of the authority he was conferring on the appellant, in the consent to her appointment? It is doubtful that had he consulted a dictionary he would have been any better informed. We contend that the signing of the instrument was such a mistake, in ignorance of its purport, as will justify a court of equity in interfering to modify the judgment. (Ayers v. Buswell, 73 Mont. 518, 238 Pac. 591.)
   MR. JUSTICE MATTHEWS

delivered the opinion of the court.

Appeal from a judgment and decree revoking letters of guardianship theretofore issued to Bridget M. Burns, and awarding the custody of Pauline Marie August, the ward, to George August, her father.

The undisputed facts are that the plaintiff, George August, in the year 1916, resided in Butte with his wife, Marie Horn August, his infant daughter, Pauline Marie August, bom July 4, 1915, and his wife’s father, Kern Horn. In November of that year the wife was taken seriously ill, and removed to a hospital. In the spring of 1917 the child was taken by the father to the home of Bridget M. Burns, who resided with her husband and a number of children, and was there taken care of as though the child of Bridget M. Bums. The mother died in May, 1917, and in October, 1917, George August was drafted into the army, and sent to France. He returned to Butte in 1920, but later departed seeking for employment, and, in 1921, was located at Casper, Wyoming, where he still resides. Kern Horn died in May, 1921. He had a small life insurance policy in force at the time of his death, in which the child was named as beneficiary, but on which the insurance company denied liability. Mrs. Burns corresponded with August, who did not care to do anything in the matter of the policy, as he did not think the amount justified action. Mrs. Bums consulted with, and employed, one Dan T. Malloy, an attorney, to bring action against the insurance company and to secure her appointment as guardian of the minor. On June 15, 1921, Malloy wrote the following letter to August:

“Mrs. Burns of this city has taken up with me the matter of her being appointed guardian of your child Marie August, for the purpose of securing payment of insurance policy. I advised her that you could not be appointed in this state without being a resident here, and also that it would be necessary for her to get your consent to her appointment before she could be appointed here. If she were appointed, Mr. August, you understand that she must put up a bond equal to twice the amount of the property of the said child, also the money would be put in the bank in the child’s name and no expenditure of the same made without order and approval of the court, so the child’s interests would be protected, and I assume that is all you are interested in. Inclosed find a ‘consent to appointment’ of Mrs. Burns which if you care to, sign before a notary public on the line indicated ‘X’ and then return to me. If you want further information concerning the matter, I shall be glad to furnish you with the same.”

The “consent” referred to in the letter recites that George August is the father of the minor named; that her mother is dead; that the child is in the custody of Mrs. Burns and requests the court to appoint Bridget M. Burns guardian of the “estate and person of said minor child,” and closes: “I do hereby consent to her appointment as such by the order of the court.” It is signed by plaintiff, and duly acknowledged before a notary public.

This instrument was promptly returned to Malloy, who thereupon secured the appointment of Mrs. Burns, who thereafter duly qualified and assumed the duties of her office, and, up to the time of the entry of judgment herein, was the duly appointed, qualified and acting guardian of both the person and estate of the minor child, and had exclusive custody of and control over her. She properly cared for the child, giving her the same attention she gave her own children in the home, and the child was happy and contented; attended school and church, and did well in her studies. She had no intimation that Mrs. Burns was not her mother until she was nine or ten years old, and did not then, nor does she now, want to leave her. Plaintiff has, in recent years, visited the child at intervals of a year or more apart.

In June, 1924, plaintiff filed in the district court of Silver Bow county a petition for a writ of habeas corpus, in which he alleged that the child was held and restrained of her liberty without right or authority in law, and not by any final judgment or order of any court, and then set out the manner in which the child was placed in the home of Mrs. Burns, and that in the. year 1922 he had made demand upon Mrs. Burns that she permit him to take the child to his home in Casper, Wyoming, which demand she refused. It then recited that Mrs. Burns claims to hold the child under the appointment as guardian, but that such appointment was made for the purpose of suit against the insurance company, and that petitioner consented to such appointment on representations that such was the purpose of the proceeding, and that no representation was made to him that Mrs. Bums asserted, or would assert, any claim to the custody of the child adverse to the petitioner, or that the plaintiff was not a fit person to have the custody of his child; that the representative of Mrs. Burns had represented to him that the only purpose of the proceeding had to do with the property rights of the child; and that, therefore, the appointment was not an adjudication affecting the rights of the petitioner to the custody of the child. .

The writ was issued, and, on return, defendant answered, basing her right to the child on the order appointing her guardian of the person of the child, and alleging therein that she secured the child by answering an advertisement in a newspaper while the child’s mother was living, and that, on securing the child, the mother requested her to raise the child in case of the death of the mother. She alleged the manner in which she had cared for the child and its attachment to her, and that it was to the best interest of the child that she remain in the home of her guardian, Mrs. Burns. She then alleged matters on which she asserted that the petitioner was not a fit person to have the custody of the child.

After a full hearing, the court ordered the proceeding dismissed, the writ discharged, and the child returned to the custody of Mrs. Burns. Thereafter, on July 2, 1924, plaintiff filed in the guardianship matter a petition for the modification of the order appointing Mrs. Burns guardian, upon the. grounds set out in the petition for a writ of habeas corpus by striking therefrom the provisions constituting her the guardian of the person of the minor, and asked that he be given the custody of the child forthwith.

To this petition Mrs. Burns filed a motion to quash, which motion, after argument of counsel on the law, was by the court sustained, and the proceeding dismissed. No appeal was taken from the judgment of dismissal in either proceeding; but, on October 31, 1924, plaintiff filed complaint herein containing two causes of action, the first of which alleges that the “consent to appointment” above referred to was fraudulently prepared by defendant and her attorney in violation of the agreement between tbe parties that Mrs. Burns be appointed guardian solely for tbe purpose of suing the insurance company. This contention was apparently abandoned at the trial. The second cause of action alleges that the plaintiff, father of the child, placed her with Mrs. Burns under a contract by which she was to give the child board, lodging and care, for which he was to pay her a stipulated amount per month; that in June, 1921, Mrs. Burns and her attorney represented that , it would be necessary that she be appointed guardian for the purpose of bringing suit against the insurance company, and thereupon plaintiff entered into an agreement with the defendant that she be appointed for that purpose, and for no other, but that the attorney for the defendant, through mistake, prepared the consent so as to read that plaintiff consented to the appointment of Mrs. Burns as guardian of the person of the child also; that the instrument did not, and does not, express the agreement and understanding of the parties; and that, under the mistake of fact and the belief that it merely consented to the appointment of Mrs. Burns as guardian of the estate of the child, plaintiff signed the consent. The complaint further alleges that, under the mutual mistake of the parties, and in ignorance thereof, Mrs. Burns presented her petition for appointment, and was appointed, and that the same does not express the intention of the parties. Plaintiff alleges that he is a fit and proper person to have the custody of the child, and asks that the letters of guardianship be canceled, and that he be given the custody of the child.

By answer the defendant set up her appointment, and alleged its validity. She then set up the habeas corpus proceeding and the proceeding in the guardianship matter, with the judgment therein rendered as a bar to this action, and alleged that each of said judgments was final, duly given, and made in proceedings between the same parties on the same matters in controversy, and that those matters are now res adjudicatei. Paragraph 10 of the affirmative answer alleges that plaintiff has not supported or maintained the minor; that he has no fixed or permanent home, and no visible means of livelihood, and is not a fit and proper person to have the custody of the child. Paragraph 11 alleges the manner in which defendant has cared for the child, and that it is for the best interest of the child that she be continued in the custody of her present guardian.

Issue was joined as to the affirmative matter in the answer, by reply, wherein the institution of the proceedings mentioned and the disposition thereof were admitted. The cause was tried to the court without a jury, and, on the calling of the first witness, defendant objected to the introduction of any evidence on the ground that, under the allegations of the answer, admitted by the reply, the issues sought to be presented are res adjudicata. The motion was overruled, and thereupon Dan T. Malloy, attorney for defendant in the guardianship matter and suit against the insurance company, was permitted, over the objection of the defendant, to testify that the inclusion of the phrase “of the person” in the plaintiff’s consent to the appointment of Mrs. Burns as guardian was a mistake made by him as attorney for Mrs. Burns, and that the appointment was sought only for the purpose of bringing action against the insurance company. The witness produced his office copy of the letter he wrote August, concerning the appointment, which was admitted in evidence.

The plaintiff testified that he was the father of the child; that he placed the child with Mrs. Burns prior to the death of the mother, under an agreement to pay for her keep, and furnish her with clothes; and that he paid all charges up to 1924, when Mrs. Burns refused to accept a payment, and asserted her right to the child under her letters of guardianship. He produced numerous receipts for payments to Mrs. Burns, which were admitted in evidence. He further testified that he first made demand for the custody of the child in 1921, but was refused, on the ground that it was. best to have the child in Btitte until after the case against the insurance company was disposed of. He testified that he did not understand English very well, and, while he saw no words in the instrument designated as the consent which he did not understand, he understood that it was a request that Mrs. Burns be appointed guardian only for the purpose of the suit; that he had no home in Casper and no female relatives there, but planned on placing the child in a private home. He introduced numerous depositions from prominent residents of Casper as to his reputation as a “sober and industrious man” and a “decent and law-abiding citizen.” These were admitted over the objections of the defendant that they did not tend to prove any issues in the case. Plaintiff then rested, whereupon defendant moved for judgment in her favor on the ground that the evidence did not disclose a mistake on the part of either party, and that the questions presented were res adjudicada,. This motion was overruled.

Defendant then introduced the original records in the habeas corpus proceeding and in the application for a modification of the order appointing the guardian.

In the amended petition for the writ of habeas corpus plaintiff recited that in the summer of 1922 he “had attained a situation where he could provide a suitable and excellent home for said child, which condition still exists; that at said time last mentioned he requested said Bridget Burns to deliver said child to him to be taken to his home in Casper, Wyo., and at various times since has requested and demanded that said child be returned to him; but at all times the said Bridget Burns has refused to do so.”

Defendant produced many witnesses to show that the child had been properly cared for by her guardian; that the home surroundings were excellent; and that the child loved Mrs. Burns, would not believe that she was not her mother, and wanted to remain with her. The child was placed on the stand, and testified that she wanted to stay with Mrs. Burns, and did not want to go with her father.

The defendant testified that she obtained the child through an arrangement with plaintiff’s father-in-law, with the consent of plaintiff, that she was to have the child absolutely, and that the mother had requested her to raise the child as her own; that she had done so, and would feel as badly at its loss as she would over the loss of one of her own children; that she labored under no mistake at the time she applied for letters of guardianship, but got just what she sought. She further testified that there was no arrangement for payment for the care of the child, and that plaintiff had not so paid her. She sought to explain the payments made by testifying that she had loaned plaintiff |300 in 1920, and that the amounts paid her were in repayment and remittances to be turned over to the father-in-law in payment for burial expenses, etc., contracted at the time of the mother’s death.

Defendant then sought to introduce records showing that i» September, 1917, the bureau of child and animal protection filed a petition in the district court on behalf of the plaintiff’s father-in-law alleging that the child was neglected and abandoned by its father; that a citation was issued and hearing had, resulting in an' order committing the child to the care and guardianship of the bureau. Objections were interposed, and the offer was finally rejected on the ground that “they don’t serve any purpose in this case, because they contain matters which should have been specially pleaded.”

On the evidence adduced the court found that all of the allegations contained in plaintiff’s second cause of action are true, and that all of the allegations of the answer are true, except: (1) That a judgment was given upon the merits in the habeas corpus proceeding; (2) that the cause of action presented in the habeas corpus proceeding and guardianship matter were the same and identical cause of action stated in these proceedings, and are res adjudicata; (3) the matters stated in paragraph 10 of the answer; and (4) that it is for the best interest and welfare of the child that she be permitted to remain in the cafe and custody of her present guardian. On the findings the court entered judgment and decree modifying the order appointing the guardian as prayed, and awarding the custody of the child to plaintiff. Defendant moved for a new trial, which motion was denied.

Defendant has appealed from the judgment and makes ten specifications of error, which raise the following questions: Did the court err (1) in overruling defendant’s objection to the introduction of any evidence; (2) in overruling the objection to the testimony of defendant’s attorney in the guardianship matter; (3) in excluding the record of the proceedings instituted by the bureau of child and animal protection? (4) Is the judgment supported by the evidence and sustained by the law?

1. The first specification of error presents the question as to whether the orders made in the habeas corpus-proceeding and the application for the modification of the order appointing the guardian were res ad judicata, and therefore a bar to this proceeding.

While it is true that, in the habeas corpus proceeding, as here, the plaintiff sought to cancel or annul the order appointing defendant guardian of the person of the child, and in his amended petition set up certain of the facts contained in his complaint in the case at bar, and such a proceeding is civil in its nature, and the decision of the court awarding custody of a minor therein entered is final, except for an abuse of discretion (Ex parte Thompson, 77 Mont. 466, 251 Pac. 163), the decision of the court is res ad judicata only as to those matters properly determined by the court on the merits. (County of Silver Bow v. Kelly, 68 Mont. 194, 216 Pac. 1106; Bennetts v. Silver Bow Amusement Co., 65 Mont. 340, 211 Pac. 336.)

The purpose of a writ of habeas corpus is to determine the legality or illegality of the restraint alleged to be exercised. It is available only to those persons, or on behalf of those persons, unlawfully imprisoned or restrained of their liberty (sec. 12348, Rev. Codes 1921; State ex rel. City of Butte v. District Court, 32 Mont. 18, 79 Pac. 409), and is independent of the legal proceeding under which the detention is sought to be justified. (Ex parte Tom Tong, 108 U. S. 556, 27 L. Ed. 826, 2 Sup. Ct. Rep. 871 [see, also, Rose’s U. S. Notes].).

In State ex rel. Carroll v. District Court, 50 Mont. 428, 147 Pac. 612, this court assumed, without deciding, that the trial court had jurisdiction in a habeas corpus proceeding to discharge from custody one held under guardianship as an incompetent person, but did so only in order to determine the propriety of the court’s action in other respects. Such jurisdiction does not, in fact, exist. If the return shows restraint under a valid appointment and qualification as guardian, the restraint is legal and not illegal so far as the writ is concerned, and the order of appointment is not open to collateral attack in such proceedings except for want of jurisdiction to render it. (Ex parte Kandarian, 187 Cal. 479, 202 Pac. 647; Ex parte Ah Men, 77 Cal. 198, 11 Am. St. Rep. 263, 19 Pac. 380.)

The district court of Silver Bow county had jurisdiction to appoint guardians. The record shows that the appointment of Mrs. Burns was made on petition regularly presented, accompanied by the consent of the surviving parent, and the order appointing the guardian was made after notice and hearing pursuant to statute. (Sec. 10401, Rev. Codes 1921.) The guardian was entitled to the legal custody of the minor until she should attain her majority or marry, or until the guardian should be legally discharged. (See. 10407.) The record further shows that the order of appointment and the 'letters of guardianship had never been modified or revoked. It is therefore apparent that the court properly dismissed the proceeding and discharged the writ without passing upon the question here presented. The petitioner merely mistook his remedy.

While an election as between two available courses may bar recourse to the second on failure to secure relief through the method elected, the unsuccessful use of an inappropriate proceeding by which the party could, under the facts, receive no relief, does not preclude such party from thereafter invoking the proper remedy. (Rowell v. Smith, 123 Wis. 510, 3 Ann. Cas. 773, 102 N. W. 1; O’Meara v. McDermott, 43 Mont. 189, 115 Pac. 912; Kaufman v. Cooper, 39 Mont. 146, 101 Pac. 969.) The habeas corpus proceeding, therefore, is no bar to an action in 'the proper forum for the discharge of the guardian or the modification of the order of appointment.

2. Plaintiff next sought relief by petition in the guardianship matter. If the order dismissing his petition was a judgment on the merits, refusing to revoke letters of guardianship, as asserted by counsel for defendant, it was a bar to the present action on all questions therein decided.

However, the matter was not decided on issues framed and evidence adduced, but upon argument on motion to quash on the ground that the petition did not state facts sufficient to entitle petitioner to the relief sought. While the contention of the plaintiff in the case at bar is indicated in the petition filed in the guardianship matter, it did not properly allege that the phrase “of the person” was included in the petition for letters of guardianship and the consent thereto by the mutual mistake of the parties, which is the chief question determined by the trial court as a basis for the decision from which this appeal is taken.

“The doctrine of res adjudicata, in the strict sense, does not apply to the decision of a motion.” (28 Cyc. 20; 18 Cal. Jur. 667; Bowers v. Cherokee Bob, 46 Cal. 279; Reeves v. Best, 13 Colo. App. 225, 56 Pac. 985; Snyder v. White, 6 How. Proc. (N. Y.) 321.)

In Herd v. Tuohy, 133 Cal. 55, 65 Pac. 139, cited in 18 Cal. Jur. 667, it is said: “The refusal of a court to grant a motion to set aside a judgment cannot operate as an estoppel so as to preclude equitable relief; and where there is no evidence to show that the decision of the motion involved the same questions as are involved in the action, the court is not precluded from finding the contrary.”

The decision on. the motion to quash determined only that the petition presented did not state facts sufficient to warrant the relief sought, and did not pass upon the question of mutual mistake alleged in the complaint before us. Under the cireumstances we hold the plea of res adjudícala was n'ot available to defendant, and the court therefore did not err in overruling her objection to the introduction of testimony.

3. The next question raised is as to the action of the court in permitting defendant’s attorney to testify that the sole purpose of the appointment of a guardian was the institution of suit against the insurance company, and that the phrase “of the person” was inadvertently incorporated in the written consent submitted to plaintiff for his signature.

Section 10536, Revised Codes 1921 (amended, Chapter 83, Laws 1925), provides, among other things, that “an attorney cannot, without the consent of his client, be examined as to any communication made by the client to him, or his ¡advice given thereon in the course of professional employment.”

While the testimony here under consideration was not directly a statement of communications made by the client to the attorney or his advice thereon, it related to matters which he could only have knowledge of through conference with his client, and involved the most important issue in the case, and comes within the spirit of the prohibition contained in the statute, if not strictly within its letter. In effect, he said, “I know from what my client said to me that she sought only to be appointed for the purpose of suit; she did not direct me to apply for her appointment as guardian of the person of the minor, and I made the mistake of including that request in the instruments drawn by me.” Clearly the court erred in permitting him to so testify. (Denver Tramway Co. v. Owens, 20 Colo. 107, 36 Pac. 848.) (

However, communications of matters which the attorney must necessarily make public in the discharge of his duties are not privileged (10 Ency. of Evidence, 236), and an attorney is not prohibited from disclosing a statement made with the express intention that it be communicated to another (Franzen v. Shenk, 192 Cal. 572, 221 Pac. 932). It was therefore not error to permit the attorney to produce in court his office copy of his letter written to the plaintiff for the purpose of inducing him to sign the consent to, and request for, the appointment of defendant. Had the original of this letter been in existence, it could have been introduced without calling the attorney to the stand. Whether the error committed was prejudicial, and therefore requires a reversal, will be later considered.

4. No error was committed in excluding the record of the proceedings taken by the bureau of child and animal protection. This record, if admitted, would not only have disputed the allegations made by, and the testimony of, the plaintiff, but also the allegations of the answer and the testimony of the defendant. It did not tend to establish any issue joined, but was a departure from the pleadings and proof, and presented an alleged right entirely different from that pleaded.

5. It is next contended that the court erred in overruling a motion for nonsuit. This is an equity case, and herein such a motion is “a doubtful procedure.” (Kavanaugh v. Flavin, 35 Mont. 133, 88 Pac. 764.) Again, we have said that it is not a proper practice to grant a nonsuit in equity cases. The entire evidence of the plaintiff and defendant ought to be received, so that, on appeal, the supreme court may direct the entry of final judgment. (Stevens v. Trafton, 36 Mont. 520, 93 Pac. 810.)

Regardless of the merit of the contention of defendant on the motion, the court did not err in denying it and causing a record to be made on which the case can be finally disposed of on this appeal.

6. Does the competent evidence before the court warrant the action of the court in reforming the appointment of Mrs. Burns to apply only to the guardianship of the estate of the minor? What was sought by the plaintiff was, in effect, the revision of the contract between him and the defendant, Mrs. Burns, evidenced by his written consent to her appointment as guardian.

The Revised Codes of 1921 provide that “when, through fraud or a mutual mistake of the parties, or a mistake of one party, which the other at the time knew or suspected, a written contract does not truly express the intention of the parties, it may be revised on the application of the party aggrieved, so as to express that intention * * * ” (sec. 8726), and “for the purpose of revising a contract, it must be presumed that all the parties thereto intended to make an equitable and conscientious agreement” (sec. 8727), and “in revising a written instrument, the court may inquire what the instrument was intended to mean, and what were intended to be its legal consequences, and is not confined to the inquiry what the language of the instrument was intended to be” (sec. 8728).

The party seeking revision or reformation must establish the mutual mistake by clear, convincing and satisfactory proof in order to overcome the presumption that the writing contains the final agreement of the parties and expresses their real purpose and intent. (McNamer Realty Co. v. Sunburst Oil & Gas Co., 76 Mont. 332, 247 Pac. 166.)

Eliminating the testimony of the attorney for Mrs. Burns, we have only the letter written by him to plaintiff on the representations of which the plaintiff consented to the appointment of defendant as guardian, and the testimony of the plaintiff as to his understanding of the purpose of the apr pointment, gleaned from the letter and from communications from defendant.

From the record it is clear that, at the time she sought the appointment, the defendant, through her attorney, and by personal communications, represented to the plaintiff that the sole purpose of the proceeding was to enable her to maintain an action on behalf of the child against the insurance company. While she testified on the trial that she intended to get just what she received, at the time she sought the appointment she did not communicate such intention to the plaintiff, nor did she testify that she directed her attorney to apply for such an appointment.

Although it may be said that the mistake made was one of law rather than fact, it must be remembered that the plaintiff was a foreigner, with little knowledge of the English language, and with no knowledge of the legal consequences of the inclusion of the phrase “of the person” in his consent to the appointment, and that he had before him the representation that it was necessary that he sign the instrument submitted, in order that the child might sue on the policy of insurance, and he, in fact, intended only that an, appointment be made for that purpose. The defendant intended only to represent that such was the purpose of the consent and of the application for letters of guardianship.

Under these circumstances, and under the law above quoted, the court was justified in fin'ding that the phrase wás included in the instrument through a mutual mistake, or through a mistake on the part of the plaintiff which was known to, or suspected by, the defendant, and that the instrument did not truly express the intention of the parties. This finding we cannot now disturb, and on it the court properly held that the instrument should be revised, and the order of appointment, based thereon, should be reformed to express the true intention of the parties. As there was ample competent evidence to justify the finding, the error in admitting incompetent evidence in an equity case was harmless. (Noyes’ Estate v. Granite-Alaska Co., 64 Mont. 406, 210 Pac. 96.)

7. Finally, it is contended that it is to the best interest of the minor that she be left in the custody of Mrs. Burns. Counsel asserts that the opinion is now universal that neither of the parents of a child has any right that can be allowed to militate against the welfare of the child, citing Boles v. Boles, 60 Mont. 411, 199 Pac. 912, and other decisions of this court in divorce proceedings involving the custody of children. This is true where the court is called upon to determine between parties to an action, each of which is, under the law, entitled to the custody of the child in question; and in a proper proceeding a child may be taken from a surviving parent, or from both parents, when it appears that such are not proper persons to have the custody of the child. However, the surviving parent is legally entitled to the custody of the children (sec. 5834, Rev. Codes 1921), and is required by law to support and care for such children (sec. 5833), and the paramount interest of the child, or its wish, will not justify the court, in the absence of a showing of unfitness or inability to support a child, in arbitrarily taking a child from its natural guardian and turning it over to a stranger.

In the case at bar no showing was made of unfitness, while the plaintiff introduced testimony as to his fitness and ability to care for his child, and, while it may be lamentable that the tender ties which have been formed between the child and Mrs. Burns must be broken, the court could find therein no legal justification for awarding her custody to Mrs. Burns as against the only person legally entitled thereto, after it had found that Mrs. Burns was not legally appointed guardian of the person of the child.

The evidence and the law amply support the judgment and it must be affirmed.

Affirmed.

Mr. Chief Justice Callaway and Associate Justices Myers, Stark and Galen concur.  