Appeal from an order of the Family Court, Monroe County (Joan S. Kohout, J.), entered June 4, 2014 in a proceeding pursuant to Family Court Act article 7. The order, insofar as appealed from, held petitioner in contempt.
It is hereby ordered that the order insofar as appealed from is unanimously reversed on the law without costs, and the matter is remitted to Family Court, Monroe County, for a hearing in accordance with the following memorandum: Petitioner appeals from an order finding it in contempt of court for failing to comply with an order extending the placement of respondent through June 23, 2014. The order extending the placement provided that respondent, who was adjudicated a person in *1514need of supervision in June 2010, was not to be discharged from foster care without the permission of Family Court. Respondent threatened his foster mother in early January 2014 and, when the police arrived, he threatened them as well, resulting in his arrest and incarceration. When respondent was released from incarceration, petitioner placed him in an emergency homeless shelter for teens and filed a petition seeking to terminate his placement in foster care pursuant to Family Court Act § 756 (a) (ii) (1). Respondent, who was 18 years old at the time, moved to hold petitioner in contempt. Without addressing the petitioner’s petition, the court granted the motion, held petitioner in contempt, and fined it $250, but suspended payment of the fine upon the condition that petitioner comply with the court order.
Initially, we address respondent’s contentions that we should dismiss this appeal. Petitioner purportedly appealed from an oral ruling of the court issued on May 1, 2014 rather than the subsequent written order entered June 4, 2014. We exercise our discretion to treat the notice of appeal as valid and deem the appeal to be from the June 4, 2014 order (see CPLR 5520 [c]; Matter of Alaysha M. [Agustin M.], 89 AD3d 1467, 1467 [2011]; Matter of Anthony M., 56 AD3d 1124, 1124 [2008], lv denied 12 NY3d 702 [2009]). Next, we reject respondent’s contention that the appeal is moot because he is not presently in foster care. “Inasmuch as enduring consequences potentially flow from an order adjudicating a party in civil contempt,” we conclude that the appeal is not moot despite the fact that petitioner is not presently under an order to place respondent in foster care (Matter of Bickwid v Deutsch, 87 NY2d 862, 863 [1995]; see Matter of Jasco v Alvira, 107 AD3d 1460, 1460 [2013]). Additionally, we note that respondent could seek to be returned to foster care (see Family Ct Act § 1091), and thus the issues on the appeal could recur (see generally Matter of Hearst Corp. v Clyne, 50 NY2d 707, 714-715 [1980]). We have examined respondent’s remaining contentions in support of dismissing the appeal and conclude that they are without merit.
We agree with petitioner that the court erred in granting the motion and finding petitioner in contempt of court without conducting a hearing. We therefore reverse the order insofar as appealed from and remit the matter to Family Court for a hearing on the motion before a different judge. “To sustain a civil contempt, a lawful judicial order expressing an unequivocal mandate must have been in effect and disobeyed”; “the party to be held in contempt must have had knowledge of the order”; *1515and “prejudice to the rights of a party to the litigation must be demonstrated” (McCain v Dinkins, 84 NY2d 216, 226 [1994]). Those elements must be proved by clear and convincing evidence (see El-Dehdan v El-Dehdan, 114 AD3d 4, 10 [2013]). We agree with the court that respondent established those elements inasmuch as there was a lawful judicial order requiring respondent to be in foster care, but he was not in foster care at the time of the motion seeking to hold petitioner in contempt; petitioner was aware of the order; and respondent was prejudiced as a result. We conclude, however, that petitioner raised a valid defense, i.e., its inability to comply with the order (see generally United States v Bryan, 339 US 323, 330 [1950], reh denied 339 US 991 [1950]; El-Dehdan, 114 AD3d at 17). Petitioner submitted evidence that it contacted numerous foster homes and group homes, and none would accept respondent because of his past violent and disruptive behavior while in foster care. Respondent had a history of not following rules and using drugs. The agency that eventually accepted respondent after the finding of contempt had denied acceptance at the time of the motion. Respondent’s mother would not take him back into her home, and she told the caseworker that there were no friends or family who were willing to accept respondent “because he has burned all of his bridges with them.” Notably, petitioner did not simply ignore the order when it became apparent that it was unable to comply with it. Instead, it filed a petition seeking to terminate respondent’s placement in foster care.
In refusing to consider any reason for petitioner’s noncompliance with the order or to hold a hearing, the court relied on McCain, but we conclude that McCain is distinguishable. In that case, the City of New York was held in contempt for failing to provide shelter for homeless families and instead had them stay overnight temporarily in City Emergency Assistance Units offices (id. at 220-222). The Court rejected the City’s claims that it acted in good faith and to the best of its municipal ability to comply with the court orders (id. at 223). It affirmed the findings of the lower courts, which had rejected that defense and had rejected the City’s argument that compliance in every instance was impossible (id. at 225). The Court found that the City “tendered] legally inexcusable reasons” for failing to comply with the orders (id. at 222). In McCain, however, the City had agreed to the orders with which it later failed to comply (id.), which led the Court to conclude that “[t]he feasibility of obedience ... is not before us at this time, nor are intractable or herculean municipal efforts of a financial or political variety. The case is before us with detailed and affirmed *1516findings of a serious, significant and persisting failure to comply with judicial decrees framed and particularized in part by reluctant acquiescence and negotiation by the City itself” (id. at 226-227). The situation in the case before us is different. While it is true that petitioner agreed to the December 23, 2013 order extending respondent’s placement, the situation changed in January 2014 when respondent was arrested after threatening to shoot his foster mother. Thereafter, petitioner was unable to find any foster homes or group homes that would accept respondent. We cannot agree with the court that petitioner is precluded from raising a defense to the contempt motion especially where, as here, petitioner argued that it was respondent’s own conduct that prevented petitioner from complying with the order. We conclude that petitioner is entitled to a hearing to present any such defense. Present— Centra, J.P., Peradotto, Carni, Lindley and DeJoseph, JJ.