
260 S.W.3d 834 (2008)
John LYNCH, et al., Appellants,
v.
George A. LYNCH, et al., Respondents.
No. SC 88923.
Supreme Court of Missouri, En Banc.
May 20, 2008.
As Modified on Denial of Rehearing August 26, 2008.
*835 Harold G. Johnson, Mitchell D. Johnson, St. Ann, for Appellants.
John M. Challis, Robert J. Selsor, St. Louis, for Respondents.
MARY R. RUSSELL, Judge.
This appeal arises from the dismissal of a declaratory judgment action seeking the imposition of a constructive trust on assets that were designated under a living trust. The judgment of the trial court is reversed, and the case is remanded.

I. Facts
Harry Schoepp ("Husband") executed his last will and testament, which bequeathed his estate to his wife, Olivia Schoepp ("Wife"), unless she predeceased him. If she predeceased him, the estate would be paid to a joint revocable living trust which was executed the same day as the will.[1] The will also stated that no gift, bequest, or devise was made to Wife's descendents, because they were provided for under the terms of the trust.[2]
The trust stated that Husband and Wife could transfer or convey assets to the trust, which would be administered under its terms. Under the trust, after the death of both Husband and Wife, the remaining assets were to be distributed equally to Wife's living children and Husband's *836 sister.[3] Although the will stated that Wife's descendents would be provided for in the trust, the trust specifically stated that "no portion of the trust estate shall go to the descendents of John J. Lynch [II]."[4]
Wife died in 2003, and Husband passed away in 2005. His will was admitted to probate and was not challenged. Additionally, no contrary will or any evidence thereof was ever filed.[5] Husband's assets, which included those he received upon Wife's death, were administered and distributed according to the terms of the will and the trust. Although $75,000 of the trust's assets were from Husband's probated estate, the majority of the trust assets were from transfers made by Husband and Wife prior to either of their deaths.
Plaintiffs filed a declaratory judgment action in March 2006 seeking to have the trust assets placed in a constructive trust to be divided among both the named beneficiaries and themselves.[6] They contend that the provision of the trust prohibiting the distribution of any assets to them should be found void and unenforceable due to Wife's Alzheimer's disease and Husband's undue influence. Defendants, the beneficiaries under the trust, moved to dismiss the petition, contending that Plaintiffs did not have standing to assert their claim. The trial court granted Defendants' motion to dismiss. This Court granted transfer after opinion by the court of appeals. Mo. Const. art. V, sec. 10.

II. Standard of Review
The standard of review for a trial court's grant of a motion to dismiss is de novo. Moynihan v. Gunn, 204 S.W.3d 230, 232-33 (Mo.App.2006). When this Court reviews the dismissal of a petition for failure to state a claim, the facts contained in the petition are treated as true and they are construed liberally in favor of the plaintiffs. Ste. Genevieve Sch. Dist. R-II, et al. v. Bd. of Aldermen of Ste. Genevieve, et al., 66 S.W.3d 6, 11 (Mo. banc 2002). If the petition sets forth any set of facts that, if proven, would entitle the plaintiffs to relief, then the petition states a claim. Id. Plaintiffs' petition states a cause of action if "its averments invoke principles of substantive law [that] may entitle the plaintiff to relief." Asaro v. Cardinal Glennon Mem'l Hosp., 799 S.W.2d 595, 597 (Mo. banc 1990).

III. Can Plaintiffs Seek a Constructive Trust?
Plaintiffs had a choice to either file a constructive trust cause of action in the circuit court or to file a discovery of assets suit in the probate division under section 473.340, RSMo 2000.[7]See Jarman v. Eisenhauer, *837 744 S.W.2d 780, 782 (Mo. banc 1988) (holding that the circuit court has jurisdiction to entertain plaintiff's action for declaratory judgment after the death of one of the co-owners of an asset and that such jurisdiction is concurrent with the jurisdiction of the probate division in discovery of asset proceedings). Plaintiffs elected to file their "Petition for Declaratory Judgment and the Establishment and Imposition of a Constructive Trust" in circuit court, seeking a declaration that the trust provision that prohibited the trust assets from being distributed to them was void and unenforceable.[8]
Plaintiffs contend that because certain portions of the trust were void and unenforceable, the trial court erred in sustaining Defendants' motion to dismiss their cause of action. Their petition alleged that Wife "placed her confidence in her husband in the belief that he would act and respect her wishes to provide for [Plaintiffs] in the manor (sic) he promised he would and having failed in said promise the [Defendants] are unjustly enriched." Plaintiffs further stated that Wife "was subservient to and trusted her husband." They argue that Husband took advantage of his confidential relationship with Wife by excluding them as beneficiaries of the trust. They assert that, if they are successful in proving the allegations in their petition, a constructive trust on the trust assets should be imposed in their favor against Defendants.
Defendants contend that, even if the trial court found for Plaintiffs and determined that the challenged provision of the trust was void and unenforceable, the assets would revert to Husband's estate as a resulting trust and then be distributed according to the terms of his will. Defendants contend that Plaintiffs do not have standing. They argue that Plaintiffs cannot establish a legally cognizable interest in the outcome of the litigation because they are not named devisees under Husband's will and because they did not challenge it. Further, they assert that the statute of limitations to bring a will contest under section 473.083 has expired.
Although the statute of limitations for Plaintiffs to challenge Husband's will has expired, they are not seeking to challenge the will. They are claiming an interest in the trust. Defendants failed to raise in their pleadings at the trial court that the statute of limitations to contest the trust had run. As it is an affirmative defense, it was waived. Section 509.090; Agnew v. Union Const. Co., 291 S.W.2d 106, 108-09 (Mo.1956); Rule 55.08.
Plaintiffs dispute Defendants' claims that a resulting trust is the appropriate remedy under the facts of this case. They argue that a constructive trust should be imposed because they allege violations of confidence and fraud. In order to determine the applicability of constructive and resulting trusts, a brief explanation is helpful.
A constructive trust is an equitable device employed by "courts of equity to remedy a situation where a party has been wrongfully deprived of some right, title or interest in property as a result of fraud or violation of confidence or faith reposed in another." Kohm v. Kohm (In re Estate of Davis), 954 S.W.2d 374, 379 *838 (Mo.App.1997). The touchstone for imposition of a constructive trust is injustice or unfairness, which may be the product of undue influence or abuse of a confidential relationship. Brown v. Brown, 152 S.W.3d 911, 918 (Mo.App.2005). It is "imposed where a person who holds title to property is under a duty to convey it to another on the ground that he would be unjustly enriched if he were permitted to retain it." Matlock v. Matlock, 815 S.W.2d 110, 114 (Mo.App.1991). A constructive trust arises without regard to the parties' intention. Id.
Alternatively, a resulting trust is implied by law to "meet the requirement of justice that a legal status be given to what is the clear intention of the parties." Brown, 152 S.W.3d at 920 n. 2. It arises where "property is transferred under circumstances that raise an inference that the person who makes the transfer or causes it to be made did not intend the transferee to take the beneficial interest in the property." Matlock, 815 S.W.2d at 114. If the owner of property "gratuitously transfers it and properly manifests an intention that the transferee should hold the property in trust but the trust fails, the transferee holds the trust estate upon a resulting trust for the transferor or his estate. . . ." Theodore Short Trust v. Fuller, 7 S.W.3d 482, 493 n. 14 (Mo.App.1999).[9] However, the settlor may be refused the benefit of a resulting trust if he participated in an attempt to perpetrate a wrongful act. RONALD CHESTER & GEORGE GLEASON BOGERT, THE LAW OF TRUSTS AND TRUSTEES section 468 (3d ed.2005).
Plaintiffs seek to have a trust provision voided for alleged undue influence or violation of confidence, not for the failure of the trust. By requesting the imposition of a constructive trust on assets that Defendants are to receive, Plaintiffs pled an appropriate remedy. The dismissal of their cause of action was error. If Plaintiffs can prove the necessary facts to show that they are entitled to share in the trust's assets, the imposition of a constructive trust is a proper remedy.[10] Because the trial court dismissed Plaintiffs' suit, they did not have the opportunity to engage in discovery and attempt to demonstrate that they are entitled to a constructive trust. Plaintiffs should have been given this opportunity.[11]

IV. Conclusion
The trial court's judgment is reversed, and the cause is remanded.[12]
*839 STITH, C.J., PRICE, TEITELMAN, WOLFF and BRECKENRIDGE, JJ., and PROKES, Sp. J., concur.
NOTES
[1]  The trust was named the "George Lynch, as Trustee under a certain Trust Agreement dated August 28, 2002, entitled Harry H. Schoepp and Olivia C. Schoepp Joint Revocable Living Trust Agreement."
[2]  Wife had five children from a prior marriage: George A. Lynch, Marie Roam, Patricia Gallagher, Joan Neal, and John J. Lynch II. John J. Lynch II predeceased Husband and Wife. He was survived by two of his sons, John F. Lynch III and Stephen M. Lynch, and his grandson, Timothy J. Lynch. Timothy's father, Timothy Patrick Lynch, predeceased John J. Lynch II.
[3]  Wife's living children, George A. Lynch, Marie Roam, Patricia Gallagher, and Joan Neal, and Bernice Huber, Husband's sister, are all defendants in this case (collectively "Defendants").
[4]  John J. Lynch II, one of Wife's children, had predeceased her, and his descendents, John F. Lynch III, Stephen M. Lynch, and Timothy J. Lynch, are the plaintiffs in this case (collectively "Plaintiffs").
[5]  Plaintiffs contend that prior to executing the current will, Husband and Wife had executed mutual wills providing that, upon death, their estate would be distributed in equal shares; each of Wife's four surviving children would receive one share and one share was to be divided equally among John J. Lynch II's descendents.
[6]  Under the constructive trust, the assets would be divided into six shares. Each of the five named beneficiaries of the trust would receive one share, and Plaintiffs, as heirs of Wife's deceased son, John J. Lynch II, would divide one share equally.
[7]  All further references are to RSMo 2000, unless otherwise indicated.
[8]  Any person who is interested as or through a trustee or other fiduciary in the administration of a trust or of the estate of a decedent may have a declaration of rights or legal relations with respect to: (1) ascertaining any class of legatees or heirs; (2) directing the trustee to do or abstain from doing any particular act in their fiduciary capacity; or (3) determining any questions arising in the administration of the trust. See Rule 87.02(b); section 527.040.
[9]  A trust may fail because of the terms of the trust, applicable law, the nature of the beneficiaries, or the purposes of the trust, for example: (1) if the settlor failed to describe any beneficiaries or described them indefinitely; (2) if his trust purpose was illegal, had already been achieved, or could not be accomplished; (3) that there was a failure of consideration for the creation of the trust; or (4) that a beneficiary disclaimed or forfeited his interest. RONALD CHESTER & GEORGE GLEASON BOGERT, THE LAW OF TRUSTS AND TRUSTEES section 468 (3d ed.2005).
[10]  "To establish a constructive trust, an extraordinary degree of proof is required. The evidence must be unquestionable in character. The evidence must be so clear, cogent, and convincing as to exclude every reasonable doubt in the mind of the trial court." Fix v. Fix, 847 S.W.2d 762, 765 (Mo. banc 1993).
[11]  This Court is not expressing an opinion as to whether, after discovery, Plaintiffs will be able to produce admissible evidence to show that they are entitled to a share of the trust's assets and, thereby, have standing to seek the imposition of a constructive trust.
[12]  If a constructive trust is imposed on remand, Defendants will have the opportunity to raise the issue of whether the value of Husband's probated assets should be subject to the constructive trust.
