In this matrimonial action for an annulment defendant wife (hereinafter sometimes referred to as Nancy) moves for an order dismissing the complaint and directing that custody of her "incompetent” husband (hereinafter sometimes referred to as Thomas) be turned over to her so that they may return to California.
The facts leading up to the present action have been taken from a related decision of the California Supreme Court, hereinafter discussed, and are as follows:
Thomas, while residing in California, became incapacitated in March, 1974 as a result of a stroke. He was rendered paralyzed and mute and was hospitalized. On May 18, 1974 while on day leave from the hospital he married Nancy in California, whom he had been living with there for a period of approximately five years prior thereto. In June, 1974 Thomas was released from the hospital to his wife’s custody. Nancy has a master’s degree in vocational rehabilitation counseling and with the help of friends and doctors she developed a rehabilitation program for her husband.
Thomas’ mother (hereinafter sometimes referred to as Willett), a resident of Brooklyn, upon learning of her son’s illness went to California for the purpose of taking him back to Brooklyn for medical attention. It should be noted that during the eight or nine years prior to his illness Thomas and his mother saw each other on only two or three occasions and communicated infrequently. On June 11, 1974 the mother filed in the Superior Court of the City and County of San Francisco a petition to have Thomas adjudged incompetent and to have herself appointed guardian of his person and estate. Nancy filed an objection to the petition alleging in substance that it would not be in Thomas’ best interests to remove him from the family, friends and rehabilitation program which he had in the State of California.
On July 26, 1974 the Superior Court filed its formal order adjudging Thomas an incompetent, appointing Willett guardian of his person and estate and authorizing her to take Thomas to New York for medical care (Matter of Brown, Superior Court, San Francisco, Cal, No. 207730). Nancy appealed this decision and it was affirmed by the Court of Appeals of the State of California. Nancy thereupon took an *73appeal to the Supreme Court of the State of California which on August 13, 1974 granted a stay of the execution of this decision pending its final determination of the matter.
Subsequently, as related by the parties in their affidavits on this motion, Nancy brought her husband to New York in November, 1975, alleging that she did so at his request for the purpose of visiting his mother to check on the condition of her health. They stayed at the mother’s house in Brooklyn for a few days when, according to Nancy, Willett ordered her out of the house and physically restrained Thomas from leaving.
Willett commenced the present action for an annulment on behalf of her son as his "mother and natural guardian” on December 1, 1975. Shortly afterwards a controversy arose as to the defendant being able to visit with her husband, necessitating this court on January 12, 1976 to direct Willett to permit Nancy to visit her husband for three hours each day.
Thereafter, by letter dated March 5, 1976 the court was advised by defendant’s attorney that the Supreme Court of the State of California had rendered its decision. This court was furnished a copy of said decision, which affirmed the finding of - the Superior Court that Thomas was incompetent but reversed the appointment of Willett as guardian (Matter of Brown, Supreme Court, Cal, No. S.F.23372, March 2, 1976).
Turning now to the instant motion, defendant seeks to have the complaint dismissed on the ground that Willett is not authorized to bring this action in view of the California Supreme Court decision initially staying and then reversing her appointment as guardian. While the defendant does not raise any objection as to whether the court has jurisdiction of this action, I note the presence of such a question. The court will therefore, ex mero motu, first consider whether it has subject matter jurisdiction to entertain this lawsuit (Robinson v Oceanic Steam Nav. Co., 112 NY 315, 324; Cavallo v Cavallo, 79 Misc 2d 195, 198). In the event I find I do not have jurisdiction I must refuse to proceed further and dismiss the action (Robinson v Oceanic Steam Nav. Co., supra; Cavallo v Cavallo, supra).
The court’s jurisdiction in matrimonial actions is wholly statutory, the applicable statute being section 230 of the Domestic Relations Law (Eckert v Eckert, 34 AD2d 684; Cocron v Cocron, 84 Misc 2d 335, 341). The failure to meet one of the five residence requirements set forth therein would deprive the court of jurisdiction of the subject matter of this *74annulment action (Eckert v Eckert, supra; Cocron v Cocron, supra).
Relating the facts described above to the five alternative residency provisions of section 230 of the Domestic Relations Law, it is clear that none of the requirements has been met. The parties were not married in New York, the cause (i.e., their alleged invalid marriage) did not occur in New York, and neither party has resided, i.e., been domiciled (Usher v Usher, 41 AD2d 368, 370), in this State for one, let alone two years immediately preceding the commencement of this action. Since section 230 of the Domestic Relations Law speaks in terms of the parties to the marriage, meaning the husband and wife, it is quite obvious that Willett could not satisfy the statute by virtue of her own domicile in New York. Moreover, on the basis of what has transpired up to now, Willett cannot have effectuated a change of her son’s domicile from California to New York. An incompetent retains the domicile which he had at the time he was adjudged incompetent (Matter of Webber, 187 Misc 674, 676) except as may be changed by his guardian or committee with the approval of the court which rendered the adjudication (Matter of Kassler, 173 Misc 856, 858). As a result of the California decision, Willett is not her son’s guardian nor does she have the court’s approval to remove his residence to New York.
Accordingly, the court finds that it does not have jurisdiction of the subject matter of this annulment action and the complaint herein must therefore be dismissed.
The second branch of defendant’s motion — viz., directing that custody of Thomas be turned over to her — seeks relief that is in the nature of a writ of habeas corpus (see 22 Carmody-Wait [2d ed], NY Prac, § 139:1). Since sufficient evidence has been presented in this action that Thomas may be illegally imprisoned or otherwise restrained in his liberty within this State, the court on its own initiative will issue a writ of habeas corpus (CPLR 7002, subd [a]). The attorney for the defendant is hereby requested to submit such a writ forthwith for this court’s signature and the setting therein of an early date for a hearing. And effective as of the date of this memorandum decision, it is ordered that Willett, or whosoever has Thomas in custody, retain him in her custody and within the jurisdiction of this court until its further order herein. This order should also be included in the writ to be submitted.