Appeal from an order of the Family Court, Oneida County (Frank S. Cook, J), entered July 22, 2005 in a proceeding pursuant to Family Court Act article 6. The order, among other things, transferred sole custody of the parties’ son to petitioner.
It is hereby ordered that the order so appealed from be and the same hereby is unanimously affirmed without costs.
Memorandum: Petitioner commenced this proceeding seeking, inter alia, an order finding respondent in contempt of court and seeking to enforce the visitation provision with respect to the parties’ son set forth in a prior order of Family Court. Petitioner alleged willful contempt by respondent based on her failure to participate in court-ordered counseling and her failure to allow him visitation with the parties’ son pursuant to the prior order. Although petitioner did not seek a change in custody in the petition, the court informed respondent prior to the hearing on the petition that she could lose sole custody of her son. *1155Following the hearing, the court sua sponte amended the petition to reflect a request for a change in custody, in conformance with the evidence presented at the hearing, and the court transferred sole custody of the parties’ son to petitioner.
Respondent contends on appeal that the court erred in transferring custody of the parties’ son to petitioner because she-was not provided with formal notice that the court was treating the petition as seeking a change in custody and the informal notice provided to her by the court was insufficient. We reject respondent’s contention. The record establishes that respondent was adequately apprised prior to the hearing that custody was at issue, and we conclude that she had a sufficient opportunity to present any testimony and evidence relevant to the issue of custody. Indeed, the record establishes that numerous witnesses, including respondent, testified at the hearing with respect to issues bearing on the best interests of the parties’ son. Furthermore, the court took judicial notice of the previous proceedings conducted with respect to the parties, including two plenary hearings conducted on the issue of custody of the parties’ son. Consequently, we conclude that respondent had adequate notice that custody was at issue and was not prejudiced by the action of the court in sua sponte amending the petition to conform to the evidence presented at the hearing (cf. Sipos v Kelly, 66 AD2d 1022 [1978]).
We further reject respondent’s contention that the court transferred custody of the parties’ son to petitioner as a sanction for respondent’s violation of the visitation provision in the prior order. The record establishes that, in making its determination with respect to custody, the court carefully weighed all of the evidence and took into account various relevant factors, including the credibility of the witnesses, the continued acrimony between the parties, and the stability of the respective home environments (see generally Eschbach v Eschbach, 56 NY2d 167, 172-174 [1982]; Matter of Rhubart v Rhubart, 15 AD3d 936 [2005]; Fox v Fox, 177 AD2d 209, 210-211 [1992]). Present—Pigott, Jr., P.J., Hurlbutt, Martoche, Smith and Pine, JJ.