*961In an action for a divorce and ancillary relief, the defendant appeals from (1) an order of the Supreme Court, Queens County (Greco, J.), entered February 23, 2012, which denied his motion, in effect, for leave to withdraw his pending cross motion, inter alia, to modify the custody and visitation provisions of a stipulation of settlement, which motion had been made on the ground that the courts of the State of New York lacked subject matter jurisdiction over the relief requested, and (2) so much an order of the same court entered May 29, 2012, as, after a hearing, denied that branch of his cross motion which was to modify the custody and visitation provisions of the stipulation of settlement so as to award him sole residential custody of the subject child, with visitation to the mother, and the plaintiff cross-appeals from so much of the same order entered May 29, 2012, as granted that branch of the defendant’s cross motion which was to modify the stipulation of settlement so as to award the defendant sole legal custody of the subject child. In a decision and order on motion dated July 13, 2012, this Court granted the defendant’s motion to stay the enforcement of the order entered May 29, 2012, pending the hearing and determination of his appeal therefrom.
Ordered that the order entered February 23, 2012, is affirmed, without costs or disbursements; and it is further,
Ordered that the order entered May 29, 2012, is modified, on the facts, by deleting the provision thereof denying that branch of the defendant’s cross motion which was to modify the custody and visitation provisions of the stipulation of settlement so as to award him sole residential custody of the subject child, with visitation to the plaintiff, and substituting therefor a provision granting that branch of the cross motion; as so modified, the order entered May 29, 2012, is affirmed insofar as appealed and cross-appealed from, without costs or disbursements.
The parties entered into a custody stipulation that was so-ordered on December 22, 2004, and awarded the parties joint custody of the subject child, with residential custody to the mother and visitation to the father. In 2006, the father cross-moved, inter alia, to modify the stipulation so as to award him sole custody of the subject child, with visitation to the mother. In an order dated February 23, 2007, the Supreme Court awarded temporary custody of the child to the father, and this Court affirmed that order on appeal (see McAvoy v Hannigan, 41 AD3d 791 [2007]). The matter proceeded to a hearing, which continued for more than four years, at which time the matter *962was administratively transferred to Kings County, where an imminent-risk hearing was conducted. The matter was eventually remitted to Queens County and assigned to a new Justice, who took judicial notice of the prior proceedings and heard testimony of the parties, a forensic evaluator, one medical witness, and the child in camera. In an order entered May 29, 2012, the Supreme Court granted the father’s cross motion to the extent of awarding him sole legal custody of the child. The Supreme Court awarded the mother residential custody, with visitation to the father. The parties appeal and cross-appeal, respectively, from the portions of the order that were adverse to them. The father also appeals from an order denying his motion, in effect, for leave to withdraw his cross motion, thus rejecting the father’s contention that the courts of the State of New York lacked subject matter jurisdiction over the relief sought in the cross motion.
The Supreme Court properly denied the father’s motion for leave to withdraw his pending cross motion to modify the terms of the stipulation. The Supreme Court properly determined that it had jurisdiction over the father’s request to modify existing custody arrangements, which had been made in 2006 (see Domestic Relations Law §§ 76-a, 76 [1] [a]; 75-a [7]). Moreover, the Supreme Court providently exercised its discretion in determining that New York was not an inconvenient forum, and in retaining jurisdiction, since there was ample evidence of a significant connection between the child and this State (see Domestic Relations Law § 76-f [1]; Matter of Hissam v Mancini, 80 AD3d 802, 803 [2011]; see also Matter of Anthony B. v Priscilla B., 88 AD3d 590 [2011]).
Where parents enter into an agreement concerning custody, that agreement will not be modified unless there is a sufficient change in circumstances since the time of when the agreement was entered into, and unless modification of the custody arrangement is in the best interests of the child (see Baker v Baker, 66 AD3d 722, 723 [2009]; Matter of Said v Said, 61 AD3d 879, 880 [2009]). “In order to determine whether modification of a custody arrangement is in the best interests of the child, the court must weigh several factors of varying degrees of importance, including, inter alia, (1) the original placement of the child, (2) the length of that placement, (3) the child’s desires, (4) the relative fitness of the parents, (5) the quality of the home environment, (6) the parental guidance given to the child, (7) the parent’s financial status, (8) his or her ability to provide for the child’s emotional and intellectual development, and (9) the willingness of the parent to assure meaningful contact be*963tween the child and the other parent” (Matter of Mingo v Belgrave, 69 AD3d 859, 859-860 [2010]; see Cuccurullo v Cuccurullo, 21 AD3d 983, 984 [2005]).
While we are mindful that the hearing court has an advantage in being able to observe the demeanor and assess the credibility of witnesses, we “would be seriously remiss if, simply in deference to the finding of a Trial Judge,” we allowed a determination with regard to the modification of a custody agreement to stand where it lacks a sound and substantial basis in the record (Matter of Gloria S. v Richard B., 80 AD2d 72, 76 [1981]; see Matter of Moran v Cortez, 85 AD3d 795, 796-797 [2011]).
Here, considering, inter alia, the acrimony between the parties, the Supreme Court’s determination to award legal custody to the father and residential custody to the mother lacked a sound and substantial basis in the record (see generally Bliss v Ach, 56 NY2d 995, 998 [1982]). Upon review of the record properly before the Supreme Court (see CPLR 4517 [a] [2], [4]; Matter of Lane v Lane, 68 AD3d 995, 997 [2009]), we find that a sufficient change in circumstances has occurred since the December 22, 2004, so-ordered custody stipulation was issued to justify modifying that so-ordered custody stipulation, and that the child’s best interests would be served by an award of sole legal and residential custody to the father (see Matter of Mingo v Belgrave, 69 AD3d at 860). The child has been residing with the father since 2007 and is thriving in that environment (see Matter of Battista v Fasano, 41 AD3d 712, 713 [2007]).
The Supreme Court, which heard testimony from necessary witnesses and conducted an in camera interview of the child, did not violate Judiciary Law § 21 by continuing the trial, which had previously been conducted before a different Justice, and determining the issues before it (cf. Matter of Connelly-Logal v West, 272 AD2d 920 [2000]; Matter of Fellows v Fellows, 25 AD2d 865 [1966]).
Contrary to the mother’s contention, she was afforded a full and fair hearing (see Matter of Wallace v Roberts, 105 AD3d 1053 [2013]; Matter of Ira S. v Lauren S., 23 AD3d 288 [2005]).
The mother’s remaining contentions are without merit. Balkin, J.P., Hall, Lott and Sgroi, JJ., concur.