
533 N.W.2d 221 (1995)
ESTATE OF Olive Iona DYER, Deceased, By Patricia Lirot, Her Daughter and Administrator, Appellant,
v.
Glenn C. KRUG, D.L. Manlove, and Alan P. Skora, Defendants,
Davenport Medical Center, Inc. d/b/a Davenport Medical Center, Appellee.
No. 93-1907.
Supreme Court of Iowa.
May 24, 1995.
*222 Glenn L. Norris and George F. Davison, Jr., of Hawkins & Norris, Des Moines, and Norman D. Tucker of Sommers, Schwartz, Silver & Schwartz, Southfield, MI, for appellant.
Samuel S. McHard and Stephen T. Fieweger of Katz, McAndrews, Balch, Lefstein & Fieweger, P.C., Rock Island, IL, for appellee.
Considered by LARSON, P.J., and LAVORATO, NEUMAN, SNELL, and TERNUS, JJ.
TERNUS, Justice.
Patricia Lirot filed this action on behalf of the plaintiff, the estate of Olive Iona Dyer, seeking damages for the wrongful death of Dyer. Lirot sued in her capacity as the purported administrator of Dyer's estate and as Dyer's daughter. In sustaining a motion to dismiss, the district court ruled that Lirot had not been appointed the legal representative of the estate and had no standing as the decedent's daughter to file a wrongful death claim for the estate. We agree with the trial court and affirm the dismissal of the estate's petition.

I. Background Facts and Proceedings.

Olive Dyer died testate on October 21, 1991. Her last will and testament was admitted to probate several days later. Donna Sue Brees was appointed the executor of Dyer's estate.
On March 10, 1993, the executor filed her final report, advising the court that the estate could be closed. The executor reported that the sole beneficiaries under the will were Lirot, Brees, and Donald Robert Dyer III. The report does not mention a wrongful death claim. The court ordered the estate closed on March 30, 1993.
On October 7, 1993, Lirot filed this action for the estate against the defendants, Glenn C. Krug, D.O., D.L. Manlove, D.O., Alan P. Skora, D.O., Davenport Medical Center and "other persons whose identities are as yet not known to plaintiff." She claimed that the negligent acts of the defendants caused Dyer's death.
Lirot alleged in the petition that she brought this action as the decedent's "daughter and administrator." She also alleged that she had filed a petition in the Scott County District Court to reopen the Dyer estate for "purposes of investigating, preparing and prosecuting claims arising from" Dyer's death.
On October 20, 1993, the statute of limitations on Dyer's wrongful death claim expired.
Subsequently, on November 15, 1993 and before answering the petition, the appellee, Davenport Medical Center, filed a motion to dismiss alleging that Lirot did not have the capacity to bring the wrongful death action for the estate and that the statute of limitations had now run. See Iowa R.Civ.P. 104(b) (authorizing motion to dismiss for failure to state a claim upon which relief can be granted). Both parties supplemented the record with documents from the probate file. Neither party objected to this procedure.
The district court granted the medical center's motion to dismiss. We granted Lirot's application for interlocutory review.

II. Standard of Review.

Our review of a ruling on a motion to dismiss is limited to correction of errors at law. Haupt v. Miller, 514 N.W.2d 905, 907 (Iowa 1994). Any decision to sustain or overrule a motion to dismiss must rest on legal grounds. Id.
III. Consideration of Matters Outside the Pleadings.
The medical center supported its motion to dismiss with a copy of the docket entries in the probate file and the probate court's order closing the estate. Similarly, Lirot attached a copy of the executor's final report (without exhibits) to her resistance to the motion to dismiss. Neither the parties nor the district *223 court appeared to be concerned by the consideration of matters extraneous to the pleadings in disposing of the medical center's motion.
Nevertheless, we point out that a motion to dismiss is directed to the pleadings and therefore, facts outside the pleadings should not be considered. Troester v. Sisters of Mercy Health Corp., 328 N.W.2d 308, 310 (Iowa 1982). When the parties want to rely on facts not contained in the pleadings, the more appropriate procedure to follow is that outlined for summary judgments. Id. at 311 (citing Iowa R.Civ.P. 237-240).
Despite these general principles, we found it proper in Troester for the district court to consider facts extraneous to the pleadings where those facts arose after the petition was filed and were undisputed by the parties and where the issue raised in the motion was the plaintiff's capacity to sue. Id. We acted similarly in Berger v. General United Group, Inc., 268 N.W.2d 630 (Iowa 1978). There we considered facts outside the pleadings in reviewing the grant of a motion to dismiss because the parties did not object to the district court's consideration of those facts and the issues related to the plaintiff's ability to bring the suit. Berger, 268 N.W.2d at 634-35. The Berger and Troester cases can be contrasted with Warford v. Des Moines Metropolitan Transit Authority, 381 N.W.2d 622 (Iowa 1986). In Warford, we refused to consider facts not found in the petition because the parties had no notice that the district court intended to rely on extraneous facts until they received the court's ruling and because the issue raised in the motion was whether the petition stated a claim upon which relief could be granted. Warford, 381 N.W.2d at 624.
We will reluctantly consider the extraneous facts here for three reasons. First, the parties relied on the materials from the probate file in their briefing and submission of this case to the district court and on appeal. Second, the materials from the probate file generally confirm facts that are already apparent from the allegations of the petition. Those facts are that at the time the petition was filed the estate had been closed and not reopened. The only new facts added by these materials are the failure of the executor to expressly dispose of the estate's wrongful death claim and Lirot's status as one of the beneficiaries under the will. However, as we discuss below, these additional facts are not determinative of Lirot's capacity to sue on behalf of the estate anyway. Finally, we consider the additional facts because the issue raised here, as in Troester, is the plaintiff's capacity to sue rather than the adequacy of the petition to state a claim for relief. Despite our minimal consideration of extraneous facts, we note, as we did in Berger, that our action should not be used as a basis to ignore the limited scope of a motion to dismiss as set forth in rule 104(b) and our cases interpreting it. See Berger, 268 N.W.2d at 635.

IV. Lirot's Capacity to Sue.

A. Governing legal principles. A party must have the capacity to sue in order to commence and maintain a lawsuit. Huffey v. Lea, 491 N.W.2d 518, 522 (Iowa 1992); Dumbaugh v. Cascade Mfg. Co., 264 N.W.2d 763, 765 (Iowa 1978). Here Lirot claims she has the capacity to bring this wrongful death action because she is an assignee of or successor in interest to the executor of the estate. Lirot argues that upon the closing of the estate, the wrongful death claim vested by operation of law in the heirs and beneficiaries of Dyer. As one of those heirs and beneficiaries, she claims the right to prosecute this wrongful death action. Lirot makes the alternate argument that the district court should have given her time to reopen the estate and be appointed the administrator.[1]
In considering Lirot's arguments, we begin with a review of the relevant law. The power to maintain a wrongful death action is entirely statutory. Troester, 328 N.W.2d at 312. Iowa Code section 611.20 (1993) preserves any claim a decedent has prior to death. This claim expands upon death to *224 include damages resulting from the wrongful death. Id.
Iowa Code section 611.22 provides that an action within the scope of section 611.20 "may be brought ... by ... the legal representatives or successors in interest of the deceased." We have consistently held that the right to recover wrongful death damages vests exclusively in the estate representative. Troester, 328 N.W.2d at 312 (citations omitted). However, we have also recognized that an estate representative may assign a wrongful death claim. Id. (citations omitted). In addition, an assignment of a wrongful death claim may occur by operation of law under principles of subrogation. Id. (citation omitted). In cases of complete assignment or subrogation, the claim must be pursued in the name of the assignee or subrogee. Archibald v. Midwest Paper Stock Co., 158 N.W.2d 739, 743 (Iowa 1968) (where party has assigned his entire claim to another, the assignor possesses no claim upon which relief can be granted and is not the real party in interest).
B. Capacity as administrator. We first address Lirot's assertion that she should have been allowed time to reopen the estate and be appointed the administrator before the court ruled on the medical center's motion to dismiss. We think that these events would not have assisted Lirot, even if they had occurred before a ruling on the motion to dismiss.
In Pearson v. Anthony, 218 Iowa 697, 700, 254 N.W. 10, 12 (1934), we held that a plaintiff lacked capacity to bring an action for an estate when the plaintiff was not the administrator nor the executor of the estate when the action was filed. We further held that the plaintiff's subsequent appointment as administrator did not relate back to the filing of the wrongful death action, thereby retroactively establishing the capacity to sue. Pearson, 218 Iowa at 703, 254 N.W. at 13.
In Pearson, the decedent's wife filed a wrongful death action alleging that she was the administratrix of her husband's estate. Id. at 698, 254 N.W. at 11. More than a year later and more than two years after her husband's death, she was appointed the administratrix of the estate. Id. We concluded that the plaintiff had no capacity to sue when she filed the wrongful death action. Id. at 702, 254 N.W. at 13. Consequently, her commencement of the action did not toll the statute of limitations. Id. at 702-03, 254 N.W. at 13-14. We reversed a judgment in favor of the plaintiff and remanded the case to the district court with directions to dismiss the action. Id. at 703, 254 N.W. at 14.
We think the same reasoning applies here with respect to any argument based on Lirot's future appointment as the administrator of Dyer's estate. The petition shows that at the time this action was commenced, Lirot did not have the capacity to sue. Therefore, this action did not toll the statute of limitations. Any later appointment will occur after the limitations period has run. Under our holding in Pearson that appointment will not relate back. Therefore, Lirot's future appointment as administrator cannot prevent the expiration of the limitations period.[2] Consequently, there was no reason for the district court to delay ruling on the motion to dismiss pending the appointment of Lirot as the administrator.
We now consider whether any claim Lirot has as an assignee of or a successor in interest to the original executor of the Dyer estate can sustain this action.
C. Lirot's status as an assignee or successor in interest. In claiming to be an assignee of or a successor in interest to the executor, Lirot relies on our holding in Jordan v. Hunnell, 96 Iowa 334, 65 N.W. 302 (1895). In Jordan, the wife of the deceased was appointed the administratrix of her husband's estate. Jordan, 96 Iowa at 336, 65 N.W. at 303. The estate was fully settled, except a debt owed to the decedent, and *225 closed. Id. The widow subsequently filed a petition to reopen the estate and be reappointed the administratrix. Id. She requested reappointment in order to sue on the outstanding debt. Id. The district court granted the widow's request. Id.
The widow, as administratrix, then filed an action on behalf of the estate to collect the debt. Id. The defendant claimed that the district court in the prior proceeding did not have the power to reopen the estate because there were no assets requiring further administration. Id. at 337, 65 N.W. at 303. We agreed, concluding that upon the closing of the estate the claim vested in the widow and heirs of the deceased. Id. at 339, 65 N.W. at 304. We affirmed the district court's dismissal of the estate's suit. Id.
Lirot argues that the same situation exists here. She claims that when the estate was closed in March of 1993, any remaining assets of the estate vested in Dyer's heirs and beneficiaries. Her rationale is that the executor's final report operated as a transfer or assignment of the existing chose in action to the beneficiaries. Therefore, Lirot asserts, she is in this sense a "successor in interest" to the administrator within the meaning of section 611.22. See Iowa Code § 611.22 (1993) (allowing the "legal representatives or successors in interest of the deceased" to bring a wrongful death claim).
The medical center responds that the Jordan case is inapposite. It argues that the rights of heirs to debts owed to an estate are governed by common law. In contrast, the ownership of a wrongful death claim is governed by section 611.22 which places exclusive ownership in the estate representative or the decedent's successor in interest. Moreover, Iowa Code sections 613.15 and 633.336 mandate that recovery for certain elements of damages be equitably distributed to the decedent's spouse and children, a group that may be different from the decedent's heirs and beneficiaries. Finally, the medical center points out that this action was commenced by the estate as the plaintiff, not by Lirot as plaintiff.
We need not decide whether the wrongful death claim here vested in the heirs as the debt in Jordan did. Even if it did, the fact that Lirot may now own part of the claim cannot support the present action brought by the estate.
Contrary to Lirot's assertions, the Jordan case actually supports the trial court's dismissal of this suit. Assuming that the holding of Jordan applies to a wrongful death claim, the Dyer estate no longer owns that claimthe individual heirs do. Therefore, this action brought by the estate must be dismissed just as the action filed on behalf of the estate in Jordan was dismissed.
We are aware that our rules governing amendments allow the substitution of a plaintiff suing in an individual capacity for the same plaintiff suing in a representative capacity. Myers v. Chicago, Burlington & Quincy R.R., 152 Iowa 330, 331, 131 N.W. 770, 771 (1911); see M-Z Enters., Inc. v. Hawkeye-Security Ins. Co., 318 N.W.2d 408, 411 (Iowa 1982) (allowing substitution of new plaintiff after contractual limitations period had run); Iowa R.Civ.P. 88, 89. However, these rules are of no assistance to Lirot because Lirot never sought leave to amend her petition to allege a claim in her individual capacity. Rather she elected to stand on the pleadings as they were. Now it is too late to amend. Tigges v. City of Ames, 356 N.W.2d 503, 509 (Iowa 1984) (when the city's third-party petition was dismissed and it failed to plead further as permitted by Iowa Rule of Civil Procedure 86, the city could not later amend to add a theory not pled in its initial third-party petition); Halvorson v. City of Decorah, 257 Iowa 453, 456, 133 N.W.2d 232, 233 (1965) (if, after petition is dismissed, plaintiff fails to plead further within time allowed by rule 86, any later amendment is unallowable).

V. Summary.

Lirot has no capacity to bring this action on behalf of the estate because she was not the legal representative of the estate at the time suit was filed, nor did she become the legal representative before the expiration of the limitations period. Any individual interest Lirot may have in the wrongful death claim alleged in the petition cannot support this action brought by the estate. The district *226 court correctly granted the medical center's motion to dismiss.
AFFIRMED.
NOTES
[1]  Lirot has abandoned any attempt to base her capacity to sue on the fact she is the decedent's daughter.
[2]  This case is unlike Troester where we reversed the district court's dismissal of a wrongful death claim. Troester, 328 N.W.2d at 314. In Troester the appointed representative of the estate brought a wrongful death claim within the limitations period. Id. at 313. We held that the subsequent closing of the estate did not abate the pending action. Id. at 313-14. Here no one with the capacity to represent the estate filed suit before the estate was closed and the statute of limitations expired.
