In an action, inter alia, for declaratory relief, the plaintiffs appeal, as limited by their brief, from (1) so much of an order of the Supreme Court, Queens County (Cullen, J.), entered March 23, 2009, as, upon joining GuideOne Speciality Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., as a party plaintiff, denied that branch of the motion of the plaintiff Yeshiva Ohr Torah Community School, Inc., *687which was for leave to amend the complaint to add a cause of action against the defendant Flik International Corp. for contractual indemnification with respect to attorneys’ fees incurred in defending an underlying personal injury action entitled Benedicto v Yeshiva Ohr Torah Community School, Inc., commenced in the Supreme Court, Queens County, under index No. 11768/04 and, upon searching the record, awarded summary judgment to the defendant Flik International Corp. declaring that it is not obligated to defend Yeshiva Ohr Torah Community School, Inc., in the underlying action or reimburse GuideOne Specialty Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., for expenses which that plaintiff incurred in providing a defense to Yeshiva Ohr Torah Community School, Inc., in the underlying action, and (2) so much of an order of the same court entered June 17, 2009, as denied that branch'of the motion of GuideOne Specialty Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., made jointly with Yeshiva Ohr Torah Community School, Inc., which was for leave to amend the complaint to add a cause of action against the defendant Flik International Corp. for contractual indemnification, denied that branch of the motion of Yeshiva Ohr Torah Community School, Inc., made jointly with GuideOne Specialty Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., which was, in effect, for leave to renew that branch of the motion of Yeshiva Ohr Torah Community School, Inc., which was for that relief, and denied that branch of the plaintiffs’ motion which was for leave to amend the complaint to add a cause of action against the defendant Flik International Corp. for a judgment declaring that they are entitled to contractual indemnification with respect to attorneys’ fees incurred in defending the underlying personal injury action.
Ordered that the appeal by the plaintiff GuideOne Speciality Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., from so much of the order entered March 23, 2009, as denied that branch of the motion of Yeshiva Ohr Torah Community School, Inc., which was for leave to amend the complaint to add a cause of action against the defendant Flik International Corp. for contractual indemnification with respect to attorneys’ fees incurred in defending the underlying personal injury action is dismissed, as GuideOne Speciality Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., is not aggrieved by that portion of the order (see CPLR 5511); and it is further,
Ordered that the order entered March 23, 2009, is modified, *688on the law, by deleting the provision thereof searching the record and awarding summary judgment to the defendant Flik International Corp. declaring that it is not obligated to defend Yeshiva Ohr Torah Community School, Inc., in the underlying action, or to reimburse GuideOne Specialty Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc., for expenses incurred in providing a defense to Yeshiva Ohr Torah Community School, Inc., in the underlying action; as so modified, the order entered March 23, 2009, is affirmed insofar as appealed from by Yeshiva Ohr Torah Community School, Inc., without costs or disbursements; and it is further,
Ordered that the order entered June 17, 2009, is modified, on the law, by deleting the provision thereof denying that branch of the plaintiffs’ motion which was for leave to amend the complaint to add a cause of action against the defendant Flik International Corp. for a judgment declaring that they are entitled to contractual indemnification with respect to attorneys’ fees incurred in defending the underlying personal injury action, and substituting therefor a provision granting that branch of the plaintiffs’ motion; as so modified, the order entered June 17, 2009, is affirmed insofar as appealed from, without costs or disbursements.
In an order entered March 23, 2009, the Supreme Court denied that branch of the motion of Yeshiva Ohr Torah Community School, Inc. (hereinafter Yeshiva), which, upon joining GuideOne Speciality Mutual Insurance Company, as subrogee of Yeshiva Ohr Torah Community School, Inc. (hereinafter GuideOne), as a party plaintiff, was for leave to amend the complaint, in the form set forth in a first proposed amended complaint, to add a cause of action against the defendant Flik International Corp. (hereinafter Flik) for contractual indemnification with respect to attorneys’ fees incurred in defending the underlying action. The Supreme Court also searched the record and awarded summary judgment to Flik declaring that it is not obligated to defend Yeshiva in the underlying action, or reimburse GuideOne for expenses it incurred in providing a defense to Yeshiva in the underlying action. The Supreme Court based its determinations on a post-mediation agreement among the parties to the underlying action, concluding that the terms of that agreement barred such relief. However, contrary to the Supreme Court’s conclusion, the post-mediation agreement clearly and unambiguously stated that nothing therein would preclude Yeshiva, or GuideOne, as Yeshiva’s subrogee, from pursuing the recovery of those attorneys’ fees in a declaratory judgment action (see W.W.W. Assoc, v Giancontieri, 77 NY2d *689157, 162 [1990]). Accordingly, the Supreme Court should not have searched the record and awarded summary judgment in favor of Flik.
Nevertheless, the Supreme Court providently exercised its discretion in denying that branch of Yeshiva’s motion which was for leave to amend the complaint to add a cause of action for contractual indemnification, in the form set forth in the first proposed amended complaint, on the ground that “no such cause of action is pleaded in the proposed amended complaint.” Since no such cause of action was pleaded, the proposed amended complaint was “palpably insufficient to state a cause of action” (Tornheim v Blue & White Food Prods. Corp., 56 AD3d 761, 761 [2008]; see Davis & Davis v Morson, 286 AD2d 584, 585 [2001]; Stroock & Stroock & Lavan v Beltramini, 157 AD2d 590, 591 [1990]; cf. Board of Mgrs. of Park Regent Condominium v Park Regent Assoc., 71 AD3d 1070, 1071 [2010]). For the same reason, the Supreme Court also providently exercised its discretion in denying that branch of GuideOne’s motion, made jointly with Yeshiva, which was for leave to amend the complaint to add that cause of action, in the form set forth in a second proposed amended complaint, as well as that branch of Yeshiva’s motion, made jointly with GuideOne, which was, in effect, for leave to renew that branch of its prior motion which was for leave to amend the complaint to add that cause of action (see Walsh v Mystic Tank Lines Corp., 51 AD3d 908, 909 [2008]). To the extent that GuideOne was not seeking renewal, since it did not make a prior motion, the Supreme Court correctly denied that branch of the motion which was for leave to amend the complaint to add that proposed cause of action, since the second proposed amendment remained palpably insufficient. To the extent that Yeshiva sought renewal, the “new facts” offered on that branch of the motion would not have changed the Supreme Court’s prior determination since that determination was similarly based on the failure of the second proposed amended complaint to state a cause of action for contractual indemnification (CPLR 2221 [e] [2]; Jackson Hgts. Care Ctr., LLC v Bloch, 39 AD3d 477, 480 [2007] [internal quotation marks omitted]).
However, the Supreme Court should have granted the alternative branch of the plaintiffs’ motion which was for leave to amend the complaint to add a cause of action for a judgment declaring that they are entitled to contractual indemnification and reimbursement with respect to attorneys’ fees incurred in defending the underlying personal injury action. Unlike the first proposed amended complaint, the second proposed amended *690complaint stated such a cause of action, and the postmediation agreement does not bar such relief. Also, contrary to Flik’s contention, the fact that the parties settled the underlying action without any judicial determination as to who was at fault does not preclude Yeshiva, or GuideOne, as Yeshiva’s subrogee, from pursuing such a cause of action (see Yacovacci v Shoprite Supermarket, Inc., 24 AD3d 539, 541 [2005]). Moreover, contrary to Flik’s contention, the duty to defend is not dependent on the merits of the underlying complaint but, rather, “is triggered by the allegations contained in the underlying complaint” (BP A.C. Corp. v One Beacon Ins. Group, 8 NY3d 708, 714 [2007]). In addition, the proposed cause of action for declaratory relief would not cause prejudice or surprise (see Board of Mgrs. of Park Regent Condominium v Park Regent Assoc., 71 AD3d 1070, 1071 [2010]).
The parties’ remaining contentions are without merit. Rivera, J.P., Skelos, Chambers and Roman, JJ., concur.