
575 So.2d 1267 (1991)
James D. SIEGEL, Petitioner,
v.
Victoria B. SIEGEL, Respondent.
Victoria B. SIEGEL, Petitioner,
v.
James D. SIEGEL, Respondent.
Nos. 74813, 74834.
Supreme Court of Florida.
January 18, 1991.
Rehearing Denied March 21, 1991.
*1268 Robert H. Hosch, Jr. of Butler, McDonald & Moon, Orlando, for petitioner/respondent.
Dominick J. Salfi, Law Offices of Dominick J. Salfi, P.A., Altamonte Springs, for respondent/petitioner.
EHRLICH, Senior Justice.
We have for review Siegel v. Siegel, 548 So.2d 266 (Fla. 5th DCA 1989). We have jurisdiction. Art. V, § 3(b)(3), Fla. Const.
The Siegels were married in Florida in 1981. The couple's only child, Lindsey, was born in Florida in 1985. The couple resided in Florida until November 1986 when they moved to New York. The wife contends that the move was temporary; the husband asserts that the parties had become permanent residents of New York. In March 1987 the wife took the child and left New York, returning to Florida. On March 27, 1987, the husband obtained an order from the Family Court of New York granting him temporary custody of the child and ordering the wife to show cause why the temporary order should not be continued until a final hearing on the matter. The husband then came to Florida, took the child from the wife, and returned with her to New York.
On April 6, 1987, the husband initiated divorce proceedings in New York. The wife was served with process for the divorce proceedings on this date while in New York. On April 15, 1987, the wife filed a petition for dissolution of marriage in Florida. Proceedings continued in both states, with both parties filing motions to dismiss. The wife moved to dismiss the New York proceedings for lack of jurisdiction. The husband filed several motions to dismiss the Florida proceedings on the basis that the New York action had been filed prior to the Florida proceedings and because the parties had agreed to proceed under the jurisdiction of New York. These various motions to dismiss were denied in both jurisdictions.
In June, 1987, the wife appeared and, with counsel, participated in a hearing in New York before the Family Court. The New York court again awarded temporary custody to the husband and visitation to the wife and ordered a home study of the parties. On August 19, 1987, the Florida trial court conducted a hearing and found that the wife was not a resident of New York when she was served in New York. The trial court also found that the child had more substantial contact with Florida than with any other state and that neither of the two actions in New York were commenced in substantial compliance with the Uniform Child Custody Jurisdiction Act (UCCJA). On August 25, 1987, the New York Supreme Court determined that it had jurisdiction in the divorce action and rejected the wife's motion to dismiss the New York divorce proceedings.
On November 30, 1987, the wife entered into a stipulation in which she agreed to allow the New York court to resolve the custody issue and to drop her litigation in Florida. The stipulation provided that the child would reside in New York with specified visitation with the mother in Florida. An order to this effect was issued by the New York Family Court on January 29, 1988. On February 15, 1988, the wife moved to set aside the stipulation on the basis of coercion and duress but her motion was denied.
After a hearing conducted on July 27 and 28, 1988, the Florida trial court concluded that the wife's agreement to have custody resolved in New York (at the November 1987 hearing) was not knowing and voluntary, but coerced. The trial court also determined that Florida has jurisdiction over the wife, husband and minor child. The trial court rejected the husband's motion to dismiss on the basis that New York had *1269 already adjudicated child custody and, on September 2, 1988, granted a divorce and concluded it would be in the best interests of the child if the wife had sole parental responsibility.
The husband appealed the final judgment, arguing that the Florida court should have declined to exercise its jurisdiction over custody proceedings begun in Florida by the wife under the UCCJA. The husband also argued that the Florida court should have declined to exercise its jurisdiction over the dissolution of marriage because of the prior pending proceeding in New York. The Fifth District Court of Appeal concluded that to allow the wife to proceed in Florida with regard to custody under the circumstances presented would be contrary to the very purposes of the UCCJA and reversed the award of custody of the child. The district court concluded that there was no impediment to the Florida court proceeding in a dissolution action, notwithstanding the pendency of prior divorce proceedings in another state. Siegel, 548 So.2d at 268. The husband seeks review of the district court's decision regarding jurisdiction over the dissolution proceedings; the wife seeks review of the decision regarding custody jurisdiction.

Child Custody
The wife contends that the Florida trial court properly assumed jurisdiction to determine child custody because the New York court was not exercising jurisdiction substantially in conformity with the UCCJA. The wife argues the district court erred by holding that the Florida court should have declined to exercise its jurisdiction over the custody issue under section 61.1314, Florida Statutes (1987), and in reversing the custody award. We disagree and approve the district court's decision regarding custody jurisdiction.
Both Florida and New York have adopted the UCCJA. The general purposes of the act include: avoiding jurisdictional competition and conflict with courts of other states in matters of child custody; promoting cooperation with the courts of other states to the end that a custody decree is rendered in the state which can best decide the case in the interest of the child; assuring that litigation concerning the custody of a child takes place ordinarily in the state with which the child and his family have the closest connection and where significant evidence concerning the child's care, protection, training, and personal relationships is most readily available; discouraging continuing controversies over child custody; and avoiding relitigation of custody decisions of other states. § 61.1304, Fla. Stat. (1987).
The act specifically sets forth the circumstances under which a state may exercise jurisdiction to make an initial child custody determination. Section 61.1308, Florida Statutes (1987), provides, in relevant part:
(1) A court of this state which is competent to decide child custody matters has jurisdiction to make a child custody determination by initial or modification decree if:
(a) This state:
1. Is the home state of the child at the time of commencement of the proceeding, or
2. Had been the child's home state within 6 months before commencement of the proceeding and the child is absent from this state because of his removal or retention by a person claiming his custody or for other reasons, and a parent or person acting as parent continues to live in this state;
(b) It is in the best interest of the child that a court of this state assume jurisdiction because:
1. The child and his parents, or the child and at least one contestant, have a significant connection with this state, and
2. There is available in this state substantial evidence concerning the child's present or future care, protection, training, and personal relationships[.]
As the district court below correctly recognized, "[u]nder the Act, Florida would appear to have jurisdiction since it had been the child's home state within six months before commencement of the proceeding. § 61.1308(1)(a)(2), Fla. Stat. (1987). However, *1270 whether Florida should have exercised its jurisdiction is another matter." Siegel, 548 So.2d at 268.
Section 61.1314(1), Florida Statutes (1987), regarding simultaneous proceedings, provides:
A court of this state shall not exercise its jurisdiction under this act if, at the time the petition is filed, a proceeding concerning the custody of the child was pending in a court of another state exercising jurisdiction substantially in conformity with this act, unless the proceeding is stayed by the court of the other state because this state is a more appropriate forum or for other reasons.
It is therefore clear that jurisdiction may be available in more than one state. In the present case, custody proceedings were already pending in New York at the time the Florida proceedings were commenced. It would appear that New York had jurisdiction under the act pursuant to the provision which provides that a state may make an initial child custody determination if it is in the best interest of the child that a court of that state assume jurisdiction because the child and at least one contestant have a significant connection with the state and there is substantial evidence available in the state concerning the child's present or future care, protection, training, and personal relationships. See § 61.1308(1)(b), Fla. Stat. (1987); N.Y.Dom.Rel.Law § 75-d (Consol. 1987).
We agree with the district court's conclusion below:
In the case before us, custody proceedings were pending in New York at the time the Florida proceedings were commenced and the New York court had jurisdiction to determine the custody issue. The wife appeared in Family Court in New York for a custody and visitation hearing in June 1987, challenged the jurisdiction of the New York court and lost. In November 1987, the wife entered into a stipulation with her husband in which she agreed to allow the New York court to resolve the custody dispute. The wife later moved to set aside the stipulation but that motion was denied. Thus the record shows that not only were the New York custody proceedings begun prior to the Florida proceedings but that the wife had obtained New York counsel, appeared and actively litigated the issues in New York and agreed to New York as the proper forum for resolving these issues. To allow the wife to proceed in Florida after litigating and losing the custody issue in New York would be contrary to the very purposes of the Uniform Child Custody Jurisdiction Act.
548 So.2d at 268.
The wife contends the district court's decision mandates that Florida trial courts decline jurisdiction if a sister state first exercises jurisdiction, ignoring the requirement that a trial court first decide whether the sister state is properly exercising its jurisdiction, which directly conflicts with the decision of the Third District Court of Appeal in Newcomb v. Newcomb, 507 So.2d 1145 (Fla. 3d DCA 1987). We reject this argument. In Newcomb, the Third District Court of Appeal concluded that Florida was the home state of the minor child when the mother filed the Florida petition and that Florida therefore had jurisdiction to determine whether the California court (where the father had filed an action seeking change of custody), which also had jurisdiction, was exercising jurisdiction substantially in conformity with the UCCJA. The decision of the court below does not conclude that the Florida trial court should not have held a hearing in order to determine if the New York Family Court was exercising jurisdiction substantially in conformity with the act. As noted above, the district court instead determined that both Florida and New York had jurisdiction pursuant to the UCCJA; that proceedings were commenced in New York prior to commencement of the action in Florida; that to allow the wife to proceed in Florida after litigating and losing the custody issue in New York would be contrary to the purposes of the UCCJA; and, that the Florida court should have declined to exercise its jurisdiction over the custody issue under section 61.1314 in these circumstances. 548 So.2d at 268 (emphasis added). In other words, it appears the district court below merely *1271 concluded that the Florida trial court reached the wrong conclusion on the issue of whether New York was exercising its jurisdiction substantially in conformity with the UCCJA. We accordingly find no conflict between the decision below and Newcomb. However, to the extent the decision below could be read to stand for the proposition that a Florida trial court cannot hold a hearing to determine whether another state is exercising jurisdiction substantially in conformity with the UCCJA, we disapprove.
We also reject the wife's argument that the district court below erroneously held that the wife could and did confer subject matter jurisdiction upon the New York Family Court via her stipulation before that court. As previously recognized, both Florida and New York had valid jurisdiction under the UCCJA. The wife therefore did not stipulate to subject matter jurisdiction because New York had already acquired subject matter jurisdiction. When two states have proper jurisdiction, we can conceive of no impediment to the parties agreeing to the exercise of proper jurisdiction in one state in lieu of another state which also has proper jurisdiction. The district court merely pointed out the free agreement of the parties to a valid and reasonable jurisdiction. Cf. Melzer v. Witsberger, 299 Pa.Super. 153, 445 A.2d 499 (1982).
Finally, we reject the wife's argument that "the four-month contact of the child with the state of New York cannot override the significant length of time that the Parties lived in Florida, from the date of their marriage to their sudden flight from the state, along with the presence of medical records, relatives, and religious involvement of the family in Florida." To engage in such a weighing of factors in cases such as the present one would inevitably lead to unnecessary litigation between courts with concurrent jurisdiction. Certainly, as the wife points out, it would be preferable for the courts of the two states to communicate with one another when there are simultaneous proceedings in states with overlapping jurisdiction in order to decide which is the more appropriate forum and then allow the proceedings to go forward in only one forum. See § 61.1316, Fla. Stat. (1987). However, a determination by a court that valid jurisdiction should be declined in favor of another state is discretionary and if an agreement on jurisdiction is not reached between the courts of the two states, "an ultimate conflict between two opposing custody decrees is averted by the priority-of-filing rule of the Act. The second court must yield jurisdiction to the court in which a custody action was pending first." Bodenheimer, Interstate Custody: Initial Jurisdiction and Continuing Jurisdiction under the UCCJA, 14 Fam.L.Q. 203, 213 (1981); § 61.1314, Fla. Stat. (1987).

Dissolution Proceedings
The husband contends that although jurisdiction existed in the Florida trial court, the trial court improperly exercised jurisdiction over the divorce because a prior divorce action was pending in New York. The husband argues the Florida trial court should have stayed the dissolution proceedings pending before it based on the principle of comity and that the refusal to do so in the present case was an abuse of discretion. The husband also argues the district court's conclusion that there is "no impediment to the Florida court proceeding in a dissolution action when the petitioner meets the Florida residence requirements, not withstanding the pendency of prior divorce proceedings in another state," 548 So.2d at 268, is erroneous and conflicts with decisions of other district courts of appeal.
In Bedingfield v. Bedingfield, 417 So.2d 1047 (Fla. 4th DCA 1982), the husband and wife lived in Georgia during the entirety of their marriage. They had two children. The wife filed for divorce in Georgia. The Georgia trial court, after a hearing on the issue of temporary custody, made an oral ruling giving the husband liberal visitation rights. Before the court could enter its written order, the wife filed a voluntary dismissal and fled the state, taking the children with her. The Georgia Supreme *1272 Court held that the husband should be granted leave to file a counterpetition for divorce in the original action. Sometime later, the husband located the wife and children in Florida and filed a pleading in the Florida circuit court for enforcement of the foreign order, return of the children to the home state, and other relief. The wife responded by filing a counterpetition for divorce and child custody.
The trial court denied the husband's motion to dismiss the wife's counterpetition. On appeal, with regard to the trial court's refusal to dismiss or stay the dissolution proceedings, the Fourth District Court of Appeal held the trial court's ruling was erroneous because it violated the principle of priority. The district court reasoned that:
In general, where courts within one sovereignty have concurrent jurisdiction, the court which first exercises its jurisdiction acquires exclusive jurisdiction to proceed with that case. This is called the "principle of priority." Admittedly, this principle is not applicable between sovereign jurisdictions as a matter of duty. As a matter of comity, however, a court of one state may, in its discretion, stay a proceeding pending before it on the grounds that a case involving the same subject matter and parties is pending in the court of another state.
... .
... We believe that justice requires the principle of priority to apply and govern the result on the motion to stay. Here, it seems clear that the pending Georgia divorce action, which of necessity will determine the children's custody, is the proper forum for the resolution of the entire case. To fail to stay the wife's Florida divorce action will only cause unnecessary and duplicitous lawsuits. It would be oppressive to both parties.
417 So.2d at 1050 (citation omitted).
We agree with the district court's reasoning in Bedingfield. This does not mean that a trial court must always stay proceedings when prior proceedings involving the same issues and parties are pending before a court in another state, but only that ordinarily this should be the result. "There may well be circumstances under which the denial of a stay could be justified upon a showing of the prospects for undue delay in the disposition of a prior action." Schwartz v. DeLoach, 453 So.2d 454, 455 (Fla. 2d DCA 1984). There may be additional factors or circumstances which would also warrant a denial of stay by the trial court.
In conclusion, we approve that portion of the district court decision below which holds that the Florida trial court should have declined to exercise jurisdiction over the custody issue and reverses the award of custody. We quash that portion of the district court decision which holds that there was no impediment to the Florida trial court exercising jurisdiction over the dissolution action. We remand to the district court and direct that the final decree of divorce be set aside and that the trial court stay proceedings pending resolution of the New York action.
It is so ordered.
SHAW, C.J., and OVERTON, McDONALD, GRIMES and KOGAN, JJ., concur.
BARKETT, J., dissenting with an opinion.
BARKETT, Justice, dissenting.
The majority's conclusion on the custody issue is based on the premise that when two courts have concurrent jurisdiction, priority of filing controls. In my view, however, New York did not have jurisdiction in the first place and the trial judge was correct in finding that New York was not "exercising jurisdiction substantially in conformity with" the Uniform Child Custody Jurisdiction Act (UCCJA). § 61.1314(1), Fla. Stat. (1987).
Upon its adoption, the drafters of the UCCJA identified specific purposes of the act to aid in its construction. Florida adopted these general purposes in section 61.1304, Florida Statutes (1987), which includes in relevant part:
(3) [To a]ssure that litigation concerning the custody of a child takes place *1273 ordinarily in the state with which the child and his family have the closest connection and where significant evidence concerning his care, protection, training, and personal relationships is most readily available, and that courts of this state decline the exercise of jurisdiction when the child and his family have a closer connection with another state.

(Emphasis added.)
Clearly, New York did not have jurisdiction under the first prong of section 61.1308(1)(a), Florida Statutes (1987), as it was not the child's home state. Therefore, in order to acquire jurisdiction pursuant to section 61.1308(1)(b), Florida Statutes (1987),[1] the New York court had to have available "substantial evidence concerning the child's present or future care, protection, training, and personal relationships." § 61.1308(1)(b)(2), Fla. Stat. (1987); accord N.Y.Dom.Rel.Law § 75-d(1)(b) (Consol. 1979).
In this case, such evidence would be based solely on the four months that the child spent in New York as compared to the year and a half that the parties lived in Florida with their child, along with the location of medical records, the child's physician, relatives, and evidence of the parents' fitness. The Florida trial court's order, after an evidentiary hearing, found the following:
The child has more substantial contacts with Florida than with any other state. The clear weight of the evidence established that the parties were married in Florida and spent almost all of their married life in Florida; the parties were either totally or partially educated in Florida; the parties' major work histories are in Florida; [the] child was born and hospitalized immediately after birth in Florida; the child lived in Florida from her date of birth on 4/29/85 to 11/20/86 when the parties went to New York; the child was baptized in Florida and the parties were members of a church in Florida; the child's mother, two half-brothers, maternal grandmother and maternal aunt reside in Florida; many family friends reside in Florida; the child's pediatrician is in Florida; the medical records of the child and the parties are in Florida; records of the wife's emotional health are in Florida; evidence of the Husband's alleged illegal activities is in Florida; the wife's prior marital history is in Florida.
Conversely, the record shows that the New York court, without any evidentiary hearing and without any factual basis for jurisdiction, found jurisdiction based only on Mrs. Siegel's "waiver."[2] Under both New York and Florida law, however, a party cannot confer subject matter jurisdiction by agreement if there is no legal basis for jurisdiction. Brautigam v. MacVicar, 73 So.2d 863, 866 (Fla. 1954) ("Judicial power or jurisdiction cannot be conferred or given to the Court by mutual consent or stipulation."); State ex rel. Caraker v. Amidon, 68 So.2d 403, 405 (Fla. 1953) ("Jurisdiction is conferred upon a court by the Constitution or a statute and not by agreement between the parties."); Winn & Lovett Grocery Co. v. Luke, 156 Fla. 638, 641, 24 So.2d 310, 312 (1945) ("jurisdiction of the subject matter cannot be conferred by consent or failure to object"); Cates v. Heffernan, 154 Fla. 422, 431, 18 So.2d 11, 16 (1944) ("it is well settled that the parties to a cause cannot by consent confer upon a court jurisdiction of the subject matter"); Brooks v. Brooks, 546 So.2d 100, 101 (Fla. 4th DCA 1989) (When applying the UCCJA, the question of "[w]hether a parent has submitted himself to the jurisdiction of the court is irrelevant to the proper determination of which state should assume jurisdiction in a custody dispute."); Williams v. Starnes, 522 So.2d 469, 471 (Fla. 2d DCA 1988) (in custody dispute, "subject matter jurisdiction cannot be waived or conferred upon a court by consent or agreement of the parties"); accord Gomez v. Gomez, 86 *1274 A.D.2d 594, 595, 446 N.Y.S.2d 127, 129 (App.Div.) ("subject matter jurisdiction is not waivable" in custody dispute under UCCJA), aff'd, 56 N.Y.2d 746, 452 N.Y.S.2d 13, 437 N.E.2d 272 (1982). Before a court can exercise its powers, statutory predicates for jurisdiction must be met. In this case, no evidence was ever presented by either party on the issue of jurisdiction before the New York court. Thus, no determination of jurisdiction, as required by the UCCJA, was ever made.
Even if you assume concurrent jurisdiction existed, priority of filing controls "so long as the court having such priority is `exercising jurisdiction substantially in conformity with [the UCCJA].'" Hickey v. Baxter, 461 So.2d 1364, 1369 (Fla. 1st DCA 1984) (quoting § 61.1314(1), Fla. Stat. (1983)) (emphasis added); see also Newcomb v. Newcomb, 507 So.2d 1145 (Fla. 3d DCA 1987) (Florida court had jurisdiction to determine whether California court was substantially in conformity with UCCJA in custody action previously filed in California). The trial court in the instant case correctly found that the New York court was not substantially in conformity with the UCCJA.
NOTES
[1]  "The interest of the child is served when the forum has optimum access to relevant evidence about the child and family." Uniform Child Custody Jurisdiction Act, § 3, 9 U.L.A. 145, Comment (1988).
[2]  The Florida court found that Mrs. Siegel's waiver was not freely and voluntarily given.
