In an action, inter alia, to recover damages for medical malpractice, the defendants appeal from an order of the Supreme Court, Kings County (Steinhardt, J), dated October 24, 2005, which denied their motion for leave to amend their answer to assert the affirmative defense of lack of capacity to sue and to dismiss the complaint pursuant to CPLR 3211 (a) (3) and (7), or alternatively, for summary judgment dismissing the complaint.
Ordered that the order is reversed, on the law and in the exercise of discretion, with costs, and those branches of the mo*573tion which were for leave to amend the answer to assert the affirmative defense of lack of capacity to sue and to dismiss the complaint pursuant to CPLR 3211 (a) (3) are granted, and the motion is otherwise denied as academic.
On May 30, 2001 the defendant Leonard Grossman performed cosmetic surgery upon the plaintiff. The plaintiff last saw Gross-man on October 15, 2002. On November 17, 2003 the plaintiff commenced this action, alleging that the injuries she sustained, including disfiguring scarring of her breasts, was as a result of the defendants’ medical malpractice.
On November 12, 2002 the plaintiff and her husband filed a bankruptcy petition. The plaintiff secured a discharge in bankruptcy, and that proceeding was concluded in February 2003. Approximately one month before the plaintiff’s discharge in bankruptcy, the plaintiff first consulted an attorney concerning her potential claim alleging personal injury relating to her surgery. The plaintiffs purported claim against the defendants was not reflected as an asset or otherwise referred to in the bankruptcy petition filed by the plaintiff and her husband.
The defendants moved, inter alia, for leave to amend their answer to assert the defense of lack of capacity to sue and for summary judgment dismissing the complaint based upon this defense and on the merits. The branch of the motion which was for leave to amend the answer was based upon the plaintiffs failure to include her malpractice claim against the defendants in the bankruptcy proceeding, as the filing of the petition in bankruptcy resulted in divesture of the plaintiffs title to said claim (see Whelan v Longo, 7 NY3d 821 [2006], affg 23 AD3d 459 [2005]).
The Supreme Court denied that branch of the defendants’ motion which was for leave to amend the answer. This was an improvident exercise of discretion (see Nunez v Mousouras, 21 AD3d 355, 356 [2005]; Santori v Met Life, 11 AD3d 597, 598 [2004]; Goldstein v St. John’s Episcopal Hosp., 267 AD2d 426, 427 [1999]; Quiros v Polow, 135 AD2d 697, 699 [1987]). The granting of leave to amend would not have resulted in prejudice or surprise to the plaintiff, and the proposed amendment was neither palpably insufficient nor totally devoid of merit (see Leibel v Flynn Hill El. Co., 25 AD3d 768 [2006]; Nunez v Mousouras, supra; Ruby Land Dev. v Toussie, 4 AD3d 518, 519 [2004]).
Furthermore, the defendants were entitled to dismissal of the complaint based upon their affirmative defense of lack of capacity to sue (see CPLR 3211 [a] [3]; Monson v Israeli, 35 AD3d 680 [2006]; Goldstein v St. John’s Episcopal Hosp., supra; *574Quiros v Polow, supra). Miller, J.P., Crane, Lifson and Dillon, JJ., concur.