
278 N.J. Super. 363 (1995)
651 A.2d 110
G.C., PLAINTIFF-APPELLANT,
v.
M.Y., DEFENDANT-RESPONDENT.
Superior Court of New Jersey, Appellate Division.
Argued December 7, 1994.
Decided January 4, 1995.
*366 Before Judges KING,[1] MUIR, Jr., and D'ANNUNZIO.
James P. Yudes argued the cause for appellant (James P. Yudes, P.C., attorneys; Mr. Yudes and Kevin M. Mazza, on the brief).
Michael A. Conway argued the cause for respondent (Haggerty, Donohue & Monaghan, attorneys; Mr. Conway, on the brief).
Jeffrey P. Weinstein, argued as guardian ad litem of the two minor children of the marriage, (Mr. Weinstein and Rachel Zakarin, on the brief).
The opinion of the court was delivered by D'ANNUNZIO, J.A.D.
In this post-divorce litigation regarding the custody of two children, the father, a New York resident, appeals from an order transferring physical residential custody to the mother, who resides in Essex County, New Jersey, with her husband. We granted a stay of the order pending appeal and ordered that the appeal be accelerated. Thus, the children currently remain with their father in New York.
The facts material to our resolution of this appeal are not complicated. The parties were divorced in New Jersey by a judgment entered in 1987, which incorporated an agreement as to custody of the children. The children are George, who was born on December 31, 1980, and Alexander, who was born on April 14, 1982. The divorce judgment provided that the parties would have joint custody of the children and that each parent would "participate in all major decisions regarding the children's health, education *367 and well-being." The mother was named as "the primary residential parent for the children." In 1992, the father filed an application in New Jersey for a change in custody. That application was resolved by a 1993 agreement between the parties amending the divorce judgment. The amendment provided that each parent was "to have joint legal custody of the unemancipated children of the marriage." It transferred "residential responsibility" for the children to the father "starting with the 1993-1994 school year." The amendment also provided:
During this time, Father shall be the primary residential parent for the children. At the end of the 1993-1994 school year, the parties agree to discuss with each other where the children shall primarily reside thereafter. Any disagreement in this regard shall be resolved by a Court of competent jurisdiction in the State of New Jersey. During the 1993-1994 school year, the Mother shall have the same visitation rights presently enjoyed by the Father pursuant to the schedule which is part of Exhibit A.
Paragraph five of the amendment provided for mediation by a Dr. Lagos in the event of disputes between the parties. Paragraph five concluded with the requirement that "submission of the dispute to Dr. Lagos for mediation shall be a condition precedent to submitting it to a court for resolution."
The parties implemented the amendment and George and Alexander began to reside with the father in New York and were enrolled in school there in the seventh grade. During that school year, the parties disputed the residential status of the children after the 1993-1994 school year, and they met with Dr. Lagos in a mediation session in April 1994. The mediation was unsuccessful and the dispute festered. On August 29, 1994, the mother filed this application to transfer residential custody of the boys to her. The court signed an order to show cause the same day, returnable on September 8, 1994. The father filed a cross-application for residential custody. Numerous affidavits were filed with the court and the court had the benefit of a report by Jeffrey Weinstein as guardian ad litem for the children. The court heard final arguments on September 23, 1994. The court ordered a transfer in residential custody without interviewing the children and without *368 a plenary hearing, despite the court's characterization of the issue as close.[2]
We agree with the trial court that the issue was close. It appears that the boys have thrived academically, socially, athletically and in their relationship with each other during their residence in New York. There was some legitimate concern regarding the living arrangements in New York. The father had remarried and was living with his new wife and her teenage daughter in the wife's home. The wife's home had some space constraints which resulted in or aggravated some friction involving the father, the new wife and the two boys. Consequently, supplemental living space was rented around the corner. There was no evidence, however, of any imminent harm or threatened harm to the well-being of the boys as the result of this living arrangement or as the result of any other fact connected with their residence in New York. We are persuaded, therefore, that there is no justification in this record for the trial court to have made a custody decision on an emergent basis, without a plenary hearing, and in the absence of an interview with the children. R. 5:8-6; see Wilke v. Culp, 196 N.J. Super. 487, 501, 483 A.2d 420 (App.Div. 1984), certif. denied, 99 N.J. 243, 491 A.2d 728 (1985); Hallberg v. Hallberg, 113 N.J. Super. 205, 207, 273 A.2d 389 (App.Div. 1971). The mother's decision to defer her application for custody until the eve of the new school year did not justify summary treatment of the custody issue.
A plenary hearing is especially important in the context of this case. As previously indicated, the parties' agreement on a custodial arrangement was incorporated in the divorce judgment in 1987. Thereafter, the custodial arrangement was amended by an agreement between the parties. Consequently, although the issue of custody was raised and partially litigated in New Jersey on two occasions, no court has ever ruled on that issue. The amendment *369 does not reinstate the residential arrangement set forth in the divorce judgment in the event of a dispute regarding custody. To the contrary, the amendment provides that if the parties cannot agree on the residential custody arrangement to be implemented after the 1993-1994 school year, then a New Jersey court, for the first time, must decide the issue. We conclude that the issue of residential custody at this very important stage in the boys' lives, as they emerge from elementary school and are about to enter high school, should be established on the record created at a plenary hearing with its reliance on direct testimony, cross-examination and an interview with the children. Consequently, we reverse the order transferring residential custody to the mother and we remand for further proceedings.
We note, however, that both boys are in the eighth grade at the New York school and will be graduating from elementary school in June 1995. In the absence of any compelling evidence that their physical or emotional well-being is threatened by their current residential status, they shall be permitted to complete the eighth grade at their New York school.
Our remand rejects the father's contention that New Jersey courts lack jurisdiction to adjudicate the custody of George and Alexander. The father contends that New York has sole jurisdiction under the Uniform Child Custody Jurisdiction Act (the jurisdiction act), see N.J.S.A. 2A:34-28 et seq., and the Parental Kidnapping Prevention Act (PKPA), 28 U.S.C.A. § 1738A, because New York became the children's home state. Neither party, however, filed an action in New York and none is now pending.
Initially, at the proceedings below, the father raised the jurisdiction issue, but withdrew his challenge to the court's jurisdiction. As previously indicated, the father filed a cross-application for custody, thereby submitting to the court's jurisdiction.
The record establishes jurisdiction in New Jersey on three grounds. We have mentioned the first ground, the father's submission of the issue to a New Jersey court by withdrawing his *370 initial objection to jurisdiction and by affirmatively invoking the power of a New Jersey court through his cross-application for custody. Fantony v. Fantony, 21 N.J. 525, 533-35, 122 A.2d 593 (1956); Vannucchi v. Vannucchi, 113 N.J. Super. 40, 46, 272 A.2d 560 (App.Div.), certif. denied, 58 N.J. 163, 275 A.2d 744 (1971).
The second ground is the parties' agreement, contained in the amendment, to submit the custody dispute to a New Jersey court. See Rosa v. Araujo, 260 N.J. Super. 458, 464, 616 A.2d 1328 (App.Div. 1992), certif. denied, 133 N.J. 434, 627 A.2d 1140 (1993)) (requirement of personal jurisdiction may be waived by a party); Hupp v. Accessory Distributors, Inc., 193 N.J. Super. 701, 711, 475 A.2d 679 (App.Div. 1984) (a party may waive the requirement that a court have jurisdiction over him). That agreement should be enforced because: (1) the New Jersey Superior Court issued the initial custody decree as part of the divorce judgment; (2) the children resided in New Jersey with their mother and New Jersey was their home state at the time of the divorce and when the amendment was executed; (3) the period of residential custody with the father in New York was a trial period subject to further agreement or court decree; and (4) the mother continues to reside in New Jersey. See E.E.B. v. D.A., 89 N.J. 595, 446 A.2d 871 (1982), cert. denied, 459 U.S. 1210, 103 S.Ct. 1203, 75 L.Ed.2d 445, reh'g. denied, 460 U.S. 1104, 103 S.Ct. 1806, 76 L.Ed.2d 369 (1983), in which the Court noted that the jurisdiction act "does not contemplate blind obedience to home state jurisdiction.... UCCJA ... rejects a rigid rule vesting jurisdiction automatically in the home state and favors instead, a more flexible approach." Id. 89 N.J. at 610, 446 A.2d 871. The Court also ruled that "[i]n exercising its discretion within the confines of UCCJA and PKPA, a court should consider not only the literal wording of the statutes but their purpose: to define and stabilize the right to custody in the best interest of the child." Id. at 611, 446 A.2d 871. In the present case, the father's post-ruling forum shopping would defeat that statutory purpose, and we perceive no public policy basis in the record to deny enforcement of the parties' agreement to retain *371 New Jersey's jurisdiction. Cf. 2A:34-35c(4). That statute provides that the parties agreement on "another forum which is no less appropriate" is a factor in determining whether a court should decline to exercise its jurisdiction.
The father's contention that "subject" matter jurisdiction cannot be conferred on a court by agreement between the parties or by failure to object to the exercise of jurisdiction is a correct statement of law. See Peper v. Princeton University Bd. of Trustees, 77 N.J. 55, 65-66, 389 A.2d 465 (1978). But that principle of law is not applicable in the present case. New Jersey courts have subject matter jurisdiction over custody disputes. N.J. Const. art. VI, § 3, ¶ 2; N.J.S.A. 2A:34-23; N.J.S.A. 9:2-1 and -3. The jurisdiction act's provisions control the "exercise" of existing subject matter jurisdiction regarding the custody of children. Neger v. Neger, 93 N.J. 15, 27-28, 459 A.2d 628 (1983). Consequently, an agreement to retain jurisdiction in New Jersey does not impose subject matter jurisdiction on New Jersey courts.
The third ground supporting New Jersey jurisdiction is N.J.S.A. 2A:34-31a(2). That section of the jurisdiction act permits the exercise of jurisdiction "to make a child custody determination by initial or modification decree if:"
(2) It is in the best interest of the child that a court of this State assume jurisdiction because (i) the child and his parents, or the child and at least one contestant, have a significant connection with this State, and (ii) there is available in this State substantial evidence concerning the child's present or future care, protection, training, and personal relationships.
As previously indicated, both children and both parents "have a significant connection" with New Jersey and substantial evidence regarding the custody issue is available in New Jersey, the issue having been partially litigated in our courts on two prior occasions. Moreover, the guardian ad litem, Jeffrey Weinstein, has functioned in that capacity since the original divorce proceedings. Indeed, on this record, it is most appropriate that New Jersey rather than New York exercise jurisdiction since a New Jersey court issued the initial custody decree, see, Neger, supra, 93 N.J. at 30, 459 A.2d 628 (citing with approval and quoting Kumar v. *372 Superior Court, 32 Cal.3d 689, 652 P.2d 1003, 186 Cal. Rptr. 772 (1982)), and New Jersey maintains a significant connection with one parent and the children as a result of the joint custody arrangement contained in the divorce judgment and continued in the amendment.
The PKPA does not require a different result, because there are two impediments to its application in the present case. The heart of the PKPA is 28 U.S.C.A. § 1738A(a), which provides that "every State shall enforce ... any child custody determination made consistently with the provisions of this section by a court of another State." This section is not applicable because there is no custody determination by any other State regarding George and Alexander. However, 28 U.S.C.A. § 1738A(d) is applicable. It provides:
(d) The jurisdiction of a court of a State which has made a child custody determination consistently with the provisions of this section continues as long as the requirement of subsection (c)(1) of this section continues to be met and such State remains the residence of the child or of any contestant.
This section supports the exercise of jurisdiction by New Jersey courts because New Jersey issued the initial custody decree when it was the children's home state and New Jersey has jurisdiction under New Jersey law, N.J.S.A. 2A:34-31a(2), thereby fulfilling the requirement of 28 U.S.C.A. § 1738A(c)(1).[3]
The case is remanded for further proceedings consistent with this opinion regarding the custody of George and Alexander. We emphasize the necessity of resolving the issue expeditiously to enable the parties to plan for the boys admission to high school. Prior to any plenary hearing, the issue shall be submitted to mediation consistent with the amendment and R. 5:8-1.
NOTES
[1]  Judge King did not participate in oral argument. However, the parties have consented to his participation in the decision.
[2]  The court stated, "I think the scales are almost equal in this case as to where the children should live."
[3]  28 U.S.C.A. § 1738A(c)(1) provides:

(c) A child custody determination made by a court of a State is consistent with the provisions of this section only if 
(1) such court has jurisdiction under the law of such State....
