This was an action of habeas corpus for the custody of an infant a few days past one year of age. The defendant (appellee) was its maternal grandmother, and the plaintiff (appellant) had been appointed as its guardian, but was not shown to be otherwise related. The complaint alleged that the child’s father was a person of unsound mind, under guardianship in Sullivan county, Indiana, that its mother was dead, that on her death, four months before, the defendant “unlawfully and illegally took possession of said child without right”, that defendant had no natural right to the custody of the child and her custody of it had not been authorized or permitted by the petitioner *114or any court, and that plaintiff had been appointed by the circuit court of Sullivan county as guardian of “said Robert Ray Beck, minor heir of Mabel Beck, late of said county, deceased”, and had qualified as such. There was no averment that the defendant had been asked by the guardian or by anybody else tó surrender the possession of the child, and had refused, or of any facts tending to show that her possession, if lawful in the beginning, had subsequently become unlawful.
The writ which the court issued merely commanded the defendant to produce the body of said infant before the court at a time stated, there to abide the order of the court. By way of a return to the writ, the defendant first “denied each and every allegation in the petition contained”, and secondly stated facts as follows : That the infant was detained .by her and was under her care, control and protection in Greene county, Indiana; (a) that said restraint was lawful and right and was for the' best interests of the child; that its mother was her daughter; that its parents were married nine months before its birth and made their home with her continuously until the child’s father deserted its mother five months after the marriage, without cause, and thereafter its mother continued to live with defendant until her death, a’year later; that the child was born in defendant’s home in Greene county, Indiana, while its mother was so living there, and thereafter, continuously until the time of the trial, lived with defendant in her said home, and defendant had had the care, custody and support of said child all its life; that defendant supported and cared for the child’s mother during all of her married life; that its father was not present when the child was born, nor at the death and burial of its mother, but had abandoned it, and had never seen it except when it was taken to him on three occasions; that before the death of its mother, she and *115defendant agreed together that defendant was to have the custody of said child, and to maintain, board, clothe and educate it, and, pursuant to such agreement, she was furnishing it with a suitable home, and was boarding and clothing it in accordance with said agreement; (b) that the child had become attached to defendant and loved her like a mother, and its affection for her had become so firmly fixed because of the close association between them that to separate them would serve to mar and endanger the future happiness and welfare of the child; (c) that plaintiff was appointed as guardian of the child in Sullivan county, Indiana, without notice to defendant, and she never knew of it until the day this suit was brought; that the child was not a resident of Sullivan county in which the appointment was made, and had no property in said county; and that, before such appointment was made, defendant had instituted a proceeding in the Greene Circuit Court to adopt said child as her heir, which proceeding was still pending in that court; (d) that said child was delicate, and defendant’s care of it since its birth gave her a knowledge of its physical weakness, and prepared her to minister to its wants better than any one else; that it was “cutting teeth” at that time; and because of its condition and the hot weather at that time of the year (July), no change of its custody should be made; (e) that the only restraint put upon the child by defendant was to care for it and look after it as a member of her household; that she was a suitable and proper person to have the care and custody of the child, and had a good home, and was amply able to support, clothe, care for and educate said child and surround it with the necessary comforts of life, and, if permitted to retain custody of it, would do so.
Plaintiff (appellant) filed exceptions to this return, the purport of all of which was that it did not state *116facts sufficient to constitute a cause of defense to the cause of action stated in the petition, or to entitle defendant to withhold the custody of the child from the guardian. The exceptions were overruled, and plaintiff filed a reply of general denial. The cause was thereupon submitted for trial by the court, and after hearing evidence, the court entered a finding and judgment, in general terms, that the plaintiff should take nothing by his action, and that defendant was entitled to and should be awarded the custody of the child, and her costs. No bill of exceptions was filed, and neither the finding nor any action taken or omitted by the court at the trial is challenged by this appeal.
The only question discussed in appellant’s brief or in any manner presented for decision is whether or not overruling the exceptions to the return which defendant made to the writ of habeas corpus was reversible error. An exception to the return of the defendant in habeas corpus is not exactly the same as a demurrer to an answer in a. proceeding under the civil code. Cunningham v. Thomas (1865), 25 Ind. 171; McGlennan v. Margowski (1888), 90 Ind. 150, 153. Where the parties to an action for the custody of an infant child did not suffer judgment on the pleadings and exceptions thereto, but joined issues and offered evidence, and final judgment was rendered after a full hearing as to the facts, such judgment will not be set . aside because of a mere technical insufficiency of the return as pleaded and excepted to. The court having control of the infant, with the duty to award its custody as its welfare and best interests might be found to require, and possessing large discretionary powers to be exercised for its benefit, the duty and power of the court were not measured nor limited by the allegations of the return. Bullock v. Robertson (1902), 160 *117Ind. 521, 523, 524, 65 N. E. 5; Glansman v. Ledbetter (1921), 190 Ind. 505, 509, 130 N. E. 230.
However, the petition being based wholly on the alleged fact that defendant unlawfully took possession of the child without right, a return showing that it was born in her home and had lived there with its mother until the mother’s death, and that, under an agreement with the mother, defendant had thereafter continued to keep and care for it, sufficiently rebutted that charge, and showed that defendant’s possession was lawful in its inception, and unless and until it should be made unlawful, as by a demand for possession of the child by some one having a superior right, or in some other manner. Neither do we think that a teething baby must necessarily be taken from one that it has come to regard as its mother, and sent to a new home in midsummer at the behest of the guardian, if the court shall think it detrimental to the child’s health and welfare. And so far as we are advised, if a guardian were appointed for a child in a county in which neither it nor its mother had ever, resided, and in which it had no property, after a petition for its adoption had been presented to the court having jurisdiction in the county where it was born and where it actually resided, we are not prepared to say that the latter court, on being asked by habeas corpus to take the child from the one seeking to adopt it, who had not before known of the guardianship, and to give it into the custody of the guardian so appointed in the other county, would abuse its discretion if it should refuse to do so; at least, until the court which appointed the guardian could be informed of the facts and asked to set aside such appointment for lack of jurisdiction to make it (§3056 Burns 1914, §2512 R. S. 1881), and until the court in which an adoption proceeding had been commenced before *118the guardian was appointed could render final judgment in that proceeding; the guardian having been held not a necessary party to an adoption proceeding, even if lawfully.appointed. Leonard v. Honisfager (1909), 43 Ind. App. 607, 88 N. E. 91; Shirley v. Grove (1912), 51 Ind. App. 17, 98 N. E. 874.
But since the judgment must be affirmed for the reasons first stated, we shall not prolong this opinion.
The judgment is affirmed.