
89 Cal.App.3d 440 (1979)
152 Cal. Rptr. 665
COLLEEN MARIE BOSSE, Petitioner,
v.
THE SUPERIOR COURT OF SANTA CLARA COUNTY, Respondent; BROOKS CARL BOSSE, Real Party in Interest.
Docket No. 45269.
Court of Appeals of California, First District, Division Two.
February 20, 1979.
*441 COUNSEL
Howard & Varty, Wayne D. Howard and Gerald E. Varty for Petitioner.
No appearance for Respondent.
Brooks Carl Bosse, in pro. per., for Real Party in Interest.
OPINION
KANE, J.
In this child custody proceeding, petitioner (hereafter wife) contends that the decision of respondent court to retain jurisdiction over a custody determination frustrates the purpose of the Uniform Child Custody Jurisdiction Act (Civ. Code, § 5150 et seq.),[1] in light of currently parallel proceedings pending in the County of Silver Bow, State of Montana, where wife and the child have been residing for a period of about two and one-half years.[2]
*442 On January 12, 1977, an interlocutory judgment of dissolution of marriage was entered in the Superior Court of California, County of Santa Clara, wherein it was stipulated that wife have custody and control of the minor child of the parties, with specified visitation rights granted to husband.
On May 18, 1978, real party in interest (hereafter husband) sought, in the court which had issued the original custody order, an order to show cause re contempt grounded on wife's consistent refusal for over a period of two years to permit husband to communicate or visit with the minor child; and, in addition, husband moved for a change of custody and termination of child support pending the outcome of the custody determination.[3]
On June 6, 1978, the date set for the hearing on the order to show cause re contempt and the motion for change of custody and termination of child support, wife appeared specially through her attorney who moved to dismiss the matter or stay the proceedings pending commencement of an action in a sister state. The matter was continued to August 14, 1978; respondent court requested both parties to submit briefs on the motion to dismiss or stay the proceedings. In points and authorities in support of the motion to dismiss the matter or stay the proceedings, wife contended that the proceedings were governed by the Uniform Child Custody Jurisdiction Act or the doctrine of forum non conveniens, in that Montana was the "`home state'" of the child, the child was not physically present in California, and evidence of the child's present or future care, protection, training and personal relationships was more readily available in Montana. Wife provided the court with a copy of a parallel proceeding instituted by her in the County of Silver Bow, State of Montana, on June 27, 1978. Husband opposed wife's motion, contending that the doctrine of unclean hands permitted the California court to exercise its wide discretion to retain jurisdiction of the proceedings.
On August 14, 1978, the date set for hearing on the motion, wife did not appear, husband appeared through his attorney; and on August 28, *443 1978, respondent court entered its order retaining jurisdiction over the custody proceeding, the order which is the subject of these proceedings.[4]
(1) That a California court has jurisdiction to modify its original custody order we have no doubt (Clark v. Superior Court (1977) 73 Cal. App.3d 298, 305-307 [140 Cal. Rptr. 709]; Schlumpf v. Superior Court (1978) 79 Cal. App.3d 892, 898 [145 Cal. Rptr. 190]). The question presented is whether respondent court should have exercised its jurisdiction to stay the custody proceeding instituted in California pending the determination of the custody proceeding subsequently initiated by wife in Montana when Montana has been shown to be a more appropriate forum.
A court which has jurisdiction to make an initial or modification decree may decline to exercise its jurisdiction any time before making a decree if it finds that it is an inconvenient forum to make a custody determination under the circumstances of the case, and that a court of another state is a more appropriate forum (§ 5156, subd. (1)).[5]
Section 5156, subdivision (3), provides that in determining if it is an inconvenient forum, the court shall consider if it is in the interest of the child that another state assume jurisdiction. Under the criteria set forth in section 5156, subdivision (3), it is uncontroverted that Montana has been the child's home state for the past two and one-half years (§ 5156, subd. (3)(a)); Montana has a closer connection with the child and one of the contestants than does California with the child and the other contestant (§ 5156, subd. (3)(b)); evidence concerning the child's present or future care, protection, training, and personal relationships is more readily available in Montana (§ 5156, subd. (3)(c)); and that the exercise of jurisdiction by a California court could contravene the general purposes of section 5150 (§ 5156, subd. (3)(e)). Ordinarily, under these circumstances, the California court should exercise its discretion to issue a stay of the proceedings in this state to permit a final adjudication in the state *444 of the parent entitled to custody under the existing decrees (Clark v. Superior Court, supra, 73 Cal. App.3d at p. 310; Ferreira v. Ferreira (1973) 9 Cal.3d 824, 842 [109 Cal. Rptr. 80, 512 P.2d 304]).
Husband, however, opposed wife's motion to dismiss or stay the proceedings pending commencement of proceedings in Montana on the ground that the Uniform Child Custody Jurisdiction Act presupposes good faith on the part of both of the parties; that the evidence showed that wife had not acted in good faith; and that under the circumstances shown the court was entitled to direct its attention to the equities involved and to exercise the wide discretion provided under the act. Husband argues that the circumstances are such that a denial of jurisdiction on the part of a California court would in fact encourage the abuse that the act was designed to avoid. We therefore consider whether in this case the doctrine of unclean hands permits the California court to exercise its wide discretion to retain jurisdiction of the custody proceedings.[6]
The clean hands doctrine is codified in section 5157. Although section 5157 does permit a court to decline to exercise jurisdiction in circumstances where a petitioner has engaged in reprehensible conduct, none of its provisions appear to be applicable under the circumstances of this case.[7] Section 5157, subdivision (1), does not apply because wife is not petitioning for an initial decree nor has she wrongfully taken the child from another state.[8] Although section 5157, subdivision (2), would permit the Montana court to decline to exercise its jurisdiction because of wife's violation of the visitation provisions of the custody decree, that state may decline to exercise its jurisdiction only "if this is just and proper under *445 the circumstances." Section 5157, subdivision (2), contains no provision permitting a California court to retain jurisdiction because wife has violated the visitation provisions of a custody decree of this state.
Whether extraordinary relief will be granted to a petitioner with unclean hands has been considered in the context of guardianships and adoptions as follows: "Although mandamus is `generally classed as a legal remedy, the question of whether it should be applied is largely controlled by equitable considerations.' [Citation.] It has therefore been held that the writ should not issue in aid of one who does not come into court with clean hands [citation], or `Where ... the conduct of the party applying for the writ has been such as to render it inequitable to grant him relief ...' [citation]. These principles are applicable to other writ proceedings. [Citation.] In an adoption or guardianship proceeding, however, the question of clean hands is largely subordinated to the court's primary concern which is to determine what is in the best interest of the child. [Citations.]" (San Diego County Dept. of Pub. Welfare v. Superior Court (1972) 7 Cal.3d 1, 9 [101 Cal. Rptr. 541, 496 P.2d 453], italics added.)
This court is of the opinion that in child custody proceedings, as in guardianship and adoption proceedings, the question of clean hands should be subordinated to the court's primary consideration in child custody matters, as expressed in the act and in case authority, i.e., whether, under the circumstances of the case, the action taken by the court is in the interest of the child.
We conclude that under the circumstances shown to exist in this case, respondent court abused its discretion in not staying the proceedings pending the outcome of the custody proceedings pending in Montana, the home state of the child and the parent who presently has physical custody.
Let a peremptory writ of mandate issue to compel respondent court to vacate its order of August 28, 1978, in its entirety and to enter an order staying proceedings in California pending the outcome of the proceedings pending in the County of Silver Bow, State of Montana. Upon entry of the aforesaid order, respondent court shall inform the Montana court of this fact (§ 5156, subd. (8)).
Taylor, P.J., and Rouse, J., concurred.
NOTES
[1]  Unless otherwise indicated, all references will be to the Civil Code of California.
[2]  By directing the issuance of an alternative writ of mandate to be heard before this court, the Supreme Court necessarily determined that there is no adequate remedy in the ordinary course of law and that this case is a proper one for the exercise of original jurisdiction (5 Witkin, Cal. Procedure (2d ed., 1971) § 94, p. 3870).
[3]  In his declaration in support of the order to show cause re contempt, husband averred that immediately after obtaining custody of the child, wife left the state without notice to him, leaving no forwarding address; that he thereafter located her in Montana, at the home of her mother, but that she refused to communicate with him or discuss visitation; that he had posted over 50 letters asking for visitation rights and had never received an answer; that certified mail and a person-to-person telephone call were refused; and that child support checks mailed to wife were not cashed.
[4]  The court also issued certain orders ancillary to its decision to retain jurisdiction, which we do not find necessary to examine here, since the validity of these ancillary orders is dependent upon our determination of the jurisdictional issue.
[5]  "`Custody determination' means a court decision and court orders and instructions providing for the custody of a child, including visitation rights; it does not include a decision relating to child support or any other monetary obligation of any person." (§ 5151, subd. (2).)
[6]  As we have noted earlier, wife's appearance was a special one to raise the jurisdictional question. Consequently, husband's allegations of wife's unclean hands have not yet been resolved in an adversary proceeding.
[7]  Section 5157, subdivisions (1) and (2), provide as follows:

"(1) If the petitioner for an initial decree has wrongfully taken the child from another state or has engaged in similar reprehensible conduct the court may decline to exercise jurisdiction for purposes of adjudication of custody if this is just and proper under the circumstances.
"(2) Unless required in the interest of the child, the court shall not exercise its jurisdiction to modify a custody decree of another state if the petitioner, without consent of the person entitled to custody has improperly removed the child from the physical custody of the person entitled to custody or has improperly retained the child after a visit or other temporary relinquishment of physical custody. If the petitioner has violated any other provisions of a custody decree of another state the court may decline to exercise its jurisdiction if this is just and proper under the circumstances." (Italics added.)
[8]  The provisions of the original custody order contain no provision prohibiting wife from removing the child from the State of California.
