Evan B. Jackson, as Personal Representative of the Estate of Spencer A. Jackson, Appellant-Plaintiff, v. SPC Leasing, Sam Pierce, Sam Pierce Chevrolet, Inc., a Domestic For-Profit Corp., Talco Aviation Corporation d/b/a Rajay Turbo Products, Appellees-Defendants.
 Evan B. Jackson, as Personal Representative of the Estate of Spencer A. Jackson (“the Estate”), appeals the Delaware Circuit Court's order dismissing the Estate's amended complaint under Trial Rule 12(B)(6) and the court's subsequent denial of the Estate's motion to vacate dismissal/motion to correct error. The Estate presents several issues for our review. But we address three dispositive issues:
I. Whether the trial court erred when it struck the Estate's second amended complaint, which the Estate filed within ten days of notice of the trial court's order granting the defendants’ motion to dismiss under Trial Rule 12(B)(6).
II. Whether the Estate's claims under the Adult Wrongful Death Statute are time-barred.
III. Whether the Estate's alternative claims are barred under the Survival Statute.
 We reverse and remand for further proceedings.
Facts and Procedural History
 On May 5, 2019, Spencer Jackson (“Spencer”) was attempting to fly an airplane owned by his friend Sam Pierce (“Pierce”). Pierce had asked Spencer to fly the plane to a maintenance facility for a planned inspection. Shortly after takeoff, the airplane “suddenly descended and crashed[.]” Appellant's App. Vol. 2, p. 49. Spencer survived the crash, but he sustained serious injuries, including “permanent vision loss in both eyes from traumatic optic neuropathy, permanent and traumatic brain injury, and amnesia.” Id. at 50. Spencer was unable to care for himself, and he became entirely dependent on others to care for him. His son Evan was appointed Guardian over Spencer.
 On July 23, 2020, Evan, individually and as Guardian of Spencer, filed a complaint against SPC Leasing, LLC (“SPC”) and Pierce (collectively, “the Pierce Defendants”)1 alleging negligence and negligent infliction of emotional distress. The parties agreed to stay the proceeding pending an investigation by the National Transportation Safety Bureau (“NTSB”) regarding the cause of the accident. That report was finally issued on December 3, 2020.2 The Pierce Defendants then filed their answer.
 On April 3, 2021, Spencer died. On April 30, the Estate filed a notice and suggestion of death pursuant to Trial Rule 25. Also on that date, the Estate sought leave to file an amended complaint that provided in relevant part that Spencer had died as the result of injuries sustained in the May 5, 2019, crash, and that Evan had been appointed personal representative of Spencer's estate. In addition, the amended complaint sought to add additional defendants. The caption of the amended complaint named as plaintiffs Evan, individually and as personal representative of Spencer's estate, and Evan's sister, Sadie Jackson. The trial court granted the Estate's motion to amend the complaint on August 10, 2021. In the meantime, on May 13, Evan was appointed as personal representative of the Estate.
 On August 30, the Pierce Defendants filed a motion to dismiss the Estate's amended complaint under Trial Rule 12(B)(6). In that motion, the Pierce Defendants alleged that the amended complaint was “fatally flawed in a number of ways[.]” Id. at 141. They argued that the Estate's claims were governed by the Adult Wrongful Death Statute (“AWDS”) and that, because the Estate alleged that Spencer died as a result of injuries he sustained in the crash, it could not also bring a claim under the Survival Statute. Citing the AWDS, the Pierce Defendants argued that only a personal representative could maintain that action. And they asserted that the Estate's amended complaint, filed on April 30, which was before Evan's appointment as personal representative on May 13, was invalid. The Pierce Defendants argued that the two-year statute of limitations ran on May 5, 2021, thus, they alleged that the Estate's claims were barred for its failure to appoint a personal representative by that date. In addition, the Pierce Defendants argued that Trial Rule 15(C) did not save the Estate's amended complaint.
 On September 24, Evan filed a Motion for Substitution of Party under Trial Rule 25. Evan asked the trial court to substitute himself for Spencer in the cause of action. The Estate also filed a brief in opposition to the Pierce Defendants’ motion to dismiss. The Estate argued that its claim was not time-barred under the “relation-back doctrine.” Id. at 168.
 On January 12, 2022, the trial court held a hearing on the motion to dismiss the Estate's amended complaint. The Pierce Defendants argued that, because Evan was not appointed personal representative until after the two-year statute of limitations had run on the underlying tort claims, dismissal of the claims under the AWDS was warranted as a matter of law. And they argued that, because the amended complaint alleged that Spencer died of the injuries he sustained in the crash, the Survival Statute did not apply.
 In its February 10 order dismissing the Estate's amended complaint, the trial court found that its claims under the Survival Statute were barred and that the sole remedy available to the Estate was under the AWDS. And the trial court found that, because no personal representative was appointed prior to the expiration of the two-year statute of limitations applicable to the underlying tort claims, i.e., two years after the crash, the Estate's claims were barred under the AWDS. Finally, the trial court found that the only viable claims were under the AWDS, so the trial court concluded that each of the claims asserted in the Estate's amended complaint was barred.3 In its concluding paragraph, the trial court stated that its decision “also acts as a judgment on the pleadings in favor of the defendants and against the plaintiffs as to all matters and shall constitute a final judgment for purposes of appeal.” Appellant's App. Vol. 2, p. 31.
 On February 21, the Estate filed a second amended complaint. Notably, the Estate did not allege in the second amended complaint that Spencer had died as a result of the injuries he sustained in the crash. Instead, the Estate alleged, generally, that the defendants’ negligence had caused Spencer's “injuries and/or death[.]” Id. at 219. And in support of its specific claims under the Survival Statute, the Estate alleged that Spencer “suffered for nearly two years following the accident until he succumbed to causes unrelated to the aviation accident.” Id. at 227. On February 22, the Estate re-filed its “Second Amended Complaint,” which purported to correct the incorrect caption “Amended Complaint” on the pleading filed the day before.
 On March 9, the Estate filed a motion to vacate the court's February 10 order, or, in the alternative, a motion to correct error. The Estate alleged that it was entitled to amend its complaint within ten days of the trial court's order granting the Pierce Defendants’ motion to dismiss under Trial Rule 12(B)(6), which it did. The Estate alleged that the court should vacate its order for that reason. In the alternative, the Estate alleged that the trial court's sua sponte entry of judgment on the pleadings under Trial Rule 12(C) was impermissible. In its motion to correct error, the Estate argued that: the cause of Spencer's death was unclear, so its action is not barred under the Survival Statute; the statute of limitations did not run two years after the date of the crash, but, rather, two years after the NTSB report was issued; the Estate timely filed its claims under the AWDS; and the Estate timely filed its claims under the relation-back doctrine under Trial Rule 15(C).
 The Pierce Defendants filed a motion to strike the Estate's amended complaints filed after the trial court's February 10 order or, in the alternative, a motion to dismiss the Estate's second amended complaint. And on March 25, the Estate filed a notice of submission of additional authority, namely, the Indiana Supreme Court's orders tolling certain time limits because of the Covid-19 pandemic. The Estate stated that it “intend[ed] to rely upon [those orders] in support of its argument that the statute of limitations does not bar the wrongful death and/or survival action claims before [the trial court].” Appellant's App. Vol. 3, p. 98. On April 28, the trial court issued an amended order to fix a scrivener's error in its February 10 order. The trial court changed “judgment on the pleadings” to “judgment on the merits” in the conclusion paragraph of the order.
 On May 4, the trial court held a hearing on the parties’ pending motions. And on May 9, the Estate filed its third amended complaint, “which is identical to the Second Amended Complaint, just re-dated[.]” Appellant's Br. at 25. On May 13, the trial court denied the Estate's motion to vacate or in the alternative motion to correct error, and the trial court struck the Estate's amended complaint, second amended complaint, and third amended complaint. This appeal ensued.
Discussion and Decision
Standard of Review
 The trial court granted the Pierce Defendants’ motion to dismiss under Trial Rule 12(B)(6). As our Supreme Court has stated:
A motion to dismiss under Rule 12(B)(6) tests the legal sufficiency of a complaint; that is, whether the allegations in the complaint establish any set of circumstances under which a plaintiff would be entitled to relief. Thus, while we do not test the sufficiency of the facts alleged with regards to their adequacy to provide recovery, we do test their sufficiency with regards to whether or not they have stated some factual scenario in which a legally actionable injury has occurred.
A court should accept as true the facts alleged in the complaint and should not only consider the pleadings in the light most favorable to the plaintiff but also draw every reasonable inference in favor of the nonmoving party.
Trail v. Boys and Girls Club of Northwest Ind., 845 N.E.2d 130, 135 (Ind. 2006) (cleaned up). Our review of a trial court's grant or denial of a Rule 12(B)(6) motion is de novo. Charter One Mortg. Corp. v. Condra, 865 N.E.2d 602, 604 (Ind. 2007).
 Further, as our Supreme Court has stated,
[a] plaintiff “need not anticipate a statute of limitations defense and plead matter[s] in avoidance in the complaint.” Nichols v. Amax Coal Co., 490 N.E.2d 754, 755 (Ind. 1986) (adopting statement of Judge Ratliff, who dissented from denial of rehearing in Nichols v. Amax Coal Co., 482 N.E.2d 776, 778 (Ind. Ct. App. 1985)). Thus, a complaint does not fail to state a claim merely because a meritorious defense may be available. But a plaintiff may plead itself out of court if its complaint alleges, and thus admits, the essential elements of a defense. An example is where the “complaint shows on its face that the statute of limitations has run.” 490 N.E.2d at 755 (same).
Bellwether Properties, LLC v. Duke Energy Indiana, Inc., 87 N.E.3d 462, 466 (Ind. 2017).
Issue One: The Second Amended Complaint was Properly Filed
 The Estate first contends that the trial court erred when it dismissed its second amended complaint, which was filed within ten days after service of notice of the trial court's order dismissing its complaint. It is well settled that when a motion to dismiss is sustained for failure to state a claim under 12(B)(6), “the pleading may be amended once as of right pursuant to Rule 15(A) within ten  days after service of notice of the court's order[.]” T.R. 12(B). Here, then, upon the trial court's dismissal of the amended complaint under Trial Rule 12(B)(6), the Estate had ten days to amend that complaint as a matter of law. See Mourning v. Allison Transmission, Inc., 72 N.E.3d 482, 491 (Ind. Ct. App. 2017) (reversing the trial court's dismissal of complaint under Trial Rule 12 and remanding to allow amendment pursuant to Trial Rule 15(A)).
 The Pierce Defendants, however, assert that, because the trial court expressly found that “the applicable statute of limitations bars all claims plead[ed]” in the Estate's first amended complaint and entered “a judgment on the merits” of the Estate's claims, Trial Rule 12(B)(6) does not apply. Appellant's App. Vol. 2, p. 40. They argue that the Estate was not entitled to amend its complaint as of right after the entry of final judgment. In support, the Pierce Defendants cite case law setting out a trial court's discretion to permit amendments to pleadings. But that case law is inapposite here, where Trial Rule 12(B) expressly allows a party to amend a complaint within ten days of a Trial Rule 12(B) judgment.
 In essence, the trial court found that the Estate had “plead[ed] itself out of court” with its first amended complaint and purported to enter a “final judgment.” See Bellwether Properties, LLC, 87 N.E.3d at 466. But, in doing so, the trial court was merely granting the Pierce Defendants’ motion to dismiss the first amended complaint under Trial Rule 12(B)(6). Again, our review of the trial court's order is de novo. Condra, 865 N.E.2d at 604. Pursuant to Trial Rule 12, the Estate timely filed a second amended complaint which adequately set out timely claims under both the AWDS and the Survival Statute. We hold that the Estate was entitled to file its second amended complaint as of right under Trial Rule 12(B), and the trial court erred when it struck the Estate's second amended complaint.4
Issue Two: AWDS
 Because the issue of whether the Estate's claims in the second amended complaint are time barred are likely to recur on remand, we address them here. The AWDS provides in relevant part:
When the death of one is caused by the wrongful act or omission of another, the personal representative of the former may maintain an action therefore against the latter, if the former might have maintained an action had he or she, as the case may be, lived, against the latter for an injury for the same act or omission. When the death of one is caused by the wrongful act or omission of another, the action shall be commenced by the personal representative of the decedent within two (2) years[.]
Ind. Code § 34-23-1-1. In Holmes v. ACandS Inc., 709 N.E.2d 36 (Ind. Ct. App. 1999), trans. denied, this Court explained that,
[i]n Indiana it is well established that the right to maintain an action for wrongful death is purely statutory and did not exist at common law. General Motors Corp. v. Arnett, 418 N.E.2d 546, 548 (Ind. Ct. App. 1981). The purpose of the statute is not to compensate for the injury to the decedent, but rather to create a cause of action to provide a means by which the decedent's survivors may be compensated for the loss sustained by reason of such death. Fisk v. United States, 657 F.2d 167, 170 (7th Cir.1981). Because the wrongful death claim is designed to compensate for the loss to the survivors caused by the decedent's death, and not the underlying injury, the survivor's claim is independent and not derivative: “the action derives from the tortious act and not from the person of the deceased.” Id. (quoting In re Estate of Pickens v. Pickens, 255 Ind. 119, 263 N.E.2d 151, 156 (1970)). Thus the statute creates a new and independent cause of action for wrongful death. Id.
․ Since this right in Indiana is purely statutory, the two[-]year time period within which an action must be commenced is a “condition attached to the right to sue.” General Motors, 418 N.E.2d at 548 (quoting Bocek v. Inter-Insurance Exchange of Chicago Motor Club, 175 Ind.App. 69, 369 N.E.2d 1093, 1097 (1977)). This two[-]year time period is not a statute of limitation but a condition precedent to the existence of the claim. Id. The wrongful death cause of action accrues when the injured person dies. Louisville, E. & St. L. R Co. v. Clarke, 152 U.S. 230, 237, 14 S.Ct. 579, 580, 38 L.Ed. 422 (1894) (applying Indiana law).
Id. (emphases added).
 Here, Spencer died on April 3, 2021. Accordingly, the Estate's independent claims under the AWDS accrued on that date. Id.; see also I.C. § 34-23-1-1. Evan was timely appointed as personal representative thereafter, and the Estate filed the second amended complaint on February 21, 2022, which was all within two years of the date the cause of action accrued. Thus, the Estate's AWDS claim in its second amended complaint was timely filed.
 Still, the Pierce Defendants contend, and the trial court agreed, that “[a] cause of action brought under the AWD[S] must be brought within two years of the decedent's death and within two years from the accrual of the underlying tort alleged.” Appellees’ Br. at 23 (emphasis added). Thus, the Pierce Defendants argue that the Estate's AWDS claims were untimely because they were not made by May 5, 2021, or two years after the crash.
 In support of this contention, the Pierce Defendants cite our Supreme Court's opinions in Technisand, Inc. v. Melton, 898 N.E.2d 303 (Ind. 2008), and Newkirk v. Bethlehem Woods Nursing Rehabilitation Center, LLC, 898 N.E.2d 299, 302 (Ind. 2008). But we cannot agree that either Technisand or Newkirk controls here.
 In Technisand, the plaintiff alleged a wrongful death based on an underlying products liability claim. However, when the plaintiff actually filed its complaint, “the limitations period on the underlying products liability claim had not yet expired” while “the wrongful death claim ․ limitations period ․ had expired.” 898 N.E.2d at 306. Our Supreme Court held that the “products liability claim ․ terminated at [the decedent's] death” and, at that point, “only the [wrongful death] claim survived.” Id. Thus, the Court held that the plaintiff could not use the products-liability statute of limitations “as an alternative to the statute of limitation contained within” the AWDS. Id. Those facts are distinguishable from the instant case, where the Estate has filed its wrongful death claim within two years of Spencer's death.
 In Newkirk, the plaintiff alleged death resulting from medical malpractice. The plaintiff filed its first complaint within two years of the decedent's death, but beyond the two-year statute of limitations on the underlying medical negligence claim. Our Supreme Court, relying on its own precedent, held that, “if death is caused by the [alleged] malpractice, the malpractice claim terminates at the patient's death, and a wrongful death claim must be filed ․ within two years of the occurrence of the malpractice.” 898 N.E.2d at 302 (discussing Ellenwine v. Fairley, 846 N.E.2d 657 (Ind. 2006)). Those facts are also distinguishable here, where the Estate timely filed its first complaint within the limitations period for the underlying negligence claim. The policy concerns expressed by our Supreme Court in Newkirk have thus been met—the Pierce Defendants were on notice of the alleged negligence within the limitations period of that accident. Under the Pierce Defendants’ reasoning, the Estate would have had only thirty-three days after Spencer's death in which to file the AWDS claim, which is not reasonable.
 Accordingly, we hold that the Estate's AWDS claims in its second-amended complaint were timely.
Issue Three: Survival Statute Claims
 Finally, the Estate contends that its alternative claims to its AWDS claim are also not barred under Indiana's Survival Statute.5 The Survival Statute provides in relevant part that, “[i]f an individual who is entitled or liable in a cause of action dies, the cause of action survives and may be brought by or against the representative of the deceased party. . .” Ind. Code § 34-9-3-1(a). Under the Survival Statute, however, “there is no cause of action” if the decedent's death was caused by the personal injuries alleged in the complaint. See, e.g., Estate of Sears ex. rel. Sears v. Griffin, 771 N.E.2d 1136, 1138 (Ind. 2002). In other words, once a tort plaintiff dies as a result of the injuries sustained by that tort, the cause of action on the underlying tort is superseded by a wrongful-death claim.
 In its first amended complaint, the Estate alleged that Spencer had died as a result of the injuries he sustained in the crash. That allegation, on the face of it and taken as true, precluded any claims under the Survival Statute. See id. Thus, the trial court did not err when it dismissed the Estate's non-wrongful death claims under the Survival Statute in the first amended complaint.
 However, again, the Estate timely amended its complaint when it filed the second amended complaint. And in the second amended complaint, the Estate removed the specific allegation that the crash had caused Spencer's death. In place of that allegation, the Estate alleged more generally that the defendants’ negligence had caused Spencer's “injuries and/or death[.]” Appellant's App. Vol. 2, p. 219. And in support of its specific claims under the Survival Statute, the Estate alleged that Spencer “suffered for nearly two years following the accident until he succumbed to causes unrelated to the aviation accident.” Id. at 227 (emphasis added).
 As a matter of law, the allegations of the second amended complaint superseded the allegations of the first amended complaint, and those new allegations, taken as true, are consistent with claims under the Survival Statute. Indeed, the Pierce Defendants have acknowledged the Estate's right to “plead in the alternative under Trial Rule 8(E) even when wrongful death and a survival action, which are inconsistent and mutually exclusive, are pleaded.” Appellant's App. Vol. 2, p. 161 (citing Cahoon v. Cummings, 734 N.E.2d 535 (Ind. 2000)). Accordingly, the Estate's alternative claims under Indiana's Survival Statute in its second amended complaint also are not barred.6
 In sum, the trial court erred when it struck the Estate's second amended complaint, which was timely filed as of right after the trial court dismissed its first amended complaint. We hold that the Estate timely filed its claims under the AWDS. And the Estate's claims under the Survival Statute in its second amended complaint are not barred.
 Reversed and remanded for further proceedings.
1. Another defendant, Sam Pierce Chevrolet, has filed a brief on appeal, but it merely adopts and incorporates the arguments set out in the Pierce Defendants’ brief. For ease of discussion, we will generally refer to all of the relevant defendants as the “Pierce Defendants.”
2. The parties do not state what the NTSB report concluded.
3. The Estate had alleged various fraud and conspiracy claims in its amended complaint.
4. It is of no moment that the original second amended complaint filed on February 21 was entitled “amended complaint.” The Estate corrected that scrivener's error the next day.
5. The Pierce Defendants assert that the Estate has conceded that it can only seek relief under the AWDS. Appellees’ Br. at 28. That is incorrect.
6. The Pierce Defendants do not argue on appeal that the Estate's claims under the Survival Statute are time-barred.
Robb, J., and Foley, J., concur.