OPINION ON REHEARING
Relator’s motion for rehearing is overruled. The court’s ■ opinion of November 10, 1999, is withdrawn and this opinion is substituted in its place.
In this original proceeding, relator seeks a writ of mandamus directing the trial court to vacate two orders in the underlying divorce case: (1) denying reinstatement of an “original counter petition” for divorce, and (2) setting aside a mediated settlement agreement. Because the first order is not reviewable by mandamus and the second order was not a clear abuse of discretion, we deny the writ.
Background
Luckmi Kasschau (“Luckmi”), the real party in interest, sued relator, Richard Allan Kasschau (“Richard”), for divorce in the 312th District Court of Harris County. In her petition, Luckmi sought not only dissolution of the marriage, but also con-servatorship and support of their two children and division of the community estate. Richard answered the suit with a general denial, a plea for confirmation of his separate property, and a request for reimbursement, attorney’s fees, and expenses. The parties subsequently agreed to mediation. The parties settled all issues at mediation and the court approved the settlement. 1
Before the court entered judgment, however, Luckmi nonsuited her divorce petition. Unaware of the nonsuit, Richard filed an “original counter-petition” for divorce. In his counter-petition, Richard sought enforcement of the mediated settlement agreement, denied paternity of the second child born during the marriage, and asserted various tort claims against Luckmi and Shivi Kumar Pawa (“Shivi”), the alleged father of the second child. Luckmi subsequently filed in the . same court a new petition for divorce, seeking the same relief sought in her first suit. Luckmi also denied Richard’s paternity of the second child and sought various temporary orders.
Meanwhile, back in the first suit, Richard filed a motion to reinstate his counter-petition for divorce and to consolidate the two divorce actions. He also asked the court to enter judgment on the mediated settlement agreement. Luckmi opposed the motion for judgment, asserting that: (1) certain conditions precedent to judgment had not been satisfied; namely, Shivi had not filed an intervention as contem *309 plated by the settlement agreement, and (2) the settlement agreement was void because it required Richard to turn over certain audiotape recordings of Luckmi for destruction by the parties’ attorneys, an act Luckmi claimed would be illegal. See Tex Pen.Code Ann. §§ 16.02(b)(1), 37.09(a)(1) (Vernon 1994).
At a hearing on these motions, the trial court granted the motion to consolidate the two divorce actions based on its conclusion that Luckmi’s nonsuit did not defeat the mediated settlement agreement. The court, however, denied Richard’s motion to reinstate the counter-petition, finding that only Richard’s claim for attorney’s fees survived the nonsuit. The court withdrew its approval of the mediated settlement agreement, finding the agreement void and unenforceable because it required performance of an illegal act. The court put its first two rulings in writing by order signed the same day as the hearing.
After the hearing, Richard filed a request to enforce the terms of the mediated settlement agreement, except for the allegedly illegal provision. In the meantime, Shivi filed an intervention seeking to establish paternity, conservatorship and support of the second child. After the trial court signed an order setting aside the entire mediated settlement agreement, Richard filed this petition for writ of mandamus. 2
Mandamus
Mandamus relief is available if the trial court violates a duty imposed by law or clearly abuses its discretion, either in resolving factual issues or in determining legal issues when there is no adequate remedy at law.
See Walker v. Packer,
Reinstatement of the Counter-Petition
Richard first contends the trial court violated a ministerial duty by refusing to reinstate his “original counter-petition,” even though it was filed after Luck-mi’s nonsuit. Under Texas Rule of Civil Procedure 162, a plaintiff has an absolute, unqualified right to take a nonsuit before she introduces all her evidence, as long as the defendant has not made a claim for affirmative relief.
See BHP Petroleum Co., Inc. v. Millard,
The trial court did not refuse to grant a nonsuit nor did it attempt to reinstate the case without jurisdiction to do so. Instead, the court merely refused to consider Richard’s counter-petition for divorce. We can see no reason to remedy the court’s ruling by mandamus rather than by an appeal. The requirement that a person seeking mandamus relief establish the lack of an appellate remedy is a “fundamental tenet” of mandamus practice.
See In re Masonite Corp.,
Judgment on the Mediated Settlement Agreement
Richard also contends the trial court violated a ministerial duty by refusing to enter judgment on the mediated settlement agreement. Sections 6.602(b) and 158.0071(d) of the Family Code state that “a mediated settlement agreement is binding on the parties if the agreement: (1) provides in a separate paragraph that the agreement is not subject to revocation; (2) is signed by each party to the agreement; and (3) is signed by the parties’ attorney, if any, who is present at the time the agreement is signed.” Section 157.0071(d) adds the requirement of “an underlined statement that the agreement is not subject to revocation.” Finally, subsections (c) and (e) of these statutes provide that “a party is entitled to judgment” on a mediated settlement agreement that meets the above requirements “notwithstanding Rule 11 ... or another rule of law.”
It is undisputed that the mediated settlement agreement in the underlying case meets the requirements of sections 6.602(b) and 153.0071(d). Relying on these Family Code provisions, Richard argues that Luekmi could not revoke her consent to the agreement by nonsuiting her divorce action and that the trial court violated a ministerial duty by refusing to enter judgment on the agreement. Citing the noted arbitration case,
Jack B. Anglin v. Tipps,
While we find the court’s refusal to enter judgment on the mediated settlement agreement is a proper subject for mandamus, we conclude that the trial court did not violate a ministerial duty in this case. One of the two reported cases addressing section 153.0071 of the Family Code holds that subsection (e) requires the trial court to enter judgment on a mediated settlement agreement that meets the requirements of subsection (d).
See Alvarez v. Reiser,
Here, the issue is not whether Luckmi could revoke her consent to the mediated settlement agreement, but whether the agreement itself was valid and enforceable. Notably, the lower court did not rule that Luckmi had revoked her consent to the mediated settlement agreement by taking a nonsuit. To the contrary, in consolidating the two divorce actions, the court expressly stated that Luckmi’s nonsuit did not defeat the agreement. Instead of immediately entering judgment on the mediated settlement agreement, however, the trial court reviewed the agreement and concluded it was void.
Neither the plain language of the Family Code nor the holding in
Alvarez
foreclose the court’s action. First, as noted, sections 6.602 and 153.0071 of the Family Code provide that “a party is entitled to judgment” on a mediated settlement agreement if certain requirements of those statutes are met. Where, as here, the legislature has not defined the terms in the statute, we must apply their ordinary meaning.
See In re Clark,
Notwithstanding this legal conclusion, the facts of the underlying case demonstrate that the parties did not intend for the court to immediately enter judgment on the settlement agreement. Specifically, the mediated settlement agreement expressly contemplates certain contingencies in connection with Shivi’s intervention. It states that the court would likely require an intervention to resolve certain issues regarding the second child and that entry of a decree would be delayed, and agreed temporary orders entered while these issues were resolved. Thus, the facts of this case establish the trial court’s discretion to review the agreement before entering judgment. Accordingly, we hold that the trial court did not violate a ministerial duty by refusing to enter judgment on the mediated settlement agreement.
Legality of the Mediated Settlement Agreement
Finally, Richard contends the trial court clearly abused its discretion by setting aside the entire mediated settlement agreement on grounds of illegality. “A contract to do a thing which cannot be performed without violation of the law” violates public policy and is void.
See Lewis v. Davis,
At the hearing on Richard’s motions, the court heard uncontroverted testimony that Richard secretly tape recorded Luckmi’s phone conversations with various third persons. 4 Aware of these tape recordings at the time of mediation, the parties put the following provision in their settlement agreement:
Husband ordered to deliver all tape recordings of Wife and transcripts and all copies thereof to Linda Marshall [husband’s attorney] by 5:00 p.m., five days after entry of decree. Attorneys to meet, inspect, and destroy all of same. Parties enjoined from disseminating or distributing a copy of tapes or transcripts.
Taking into account that Shivi and others might urge authorities to bring criminal charges against Richard, the court concluded that this provision illegally required the parties to destroy evidence in a potential criminal proceeding brought at the instance of non-parties to the settlement agreement.
5
Section 37.09(d)(1) of
*313
the Penal Code states that “a person commits an offense if the person knowing that an offense has been committed, alters, destroys, or conceals any record, document or thing with intent to impair its verity, legibility or availability as evidence in any
subsequent
investigation or official proceeding.” Tex. Pen.Code Ann. § 37.09(d)(1) (Vernon Supp.1999) (emphasis added). This statute makes it a crime to alter or destroy evidence of a crime even before the commencement of a criminal proceeding. Richard argues the provision in question is legal because it does not require
immediate
destruction of the tapes and correspondingly prohibits dissemination of them. The Penal Code does not provide a time after which a person, knowing that an offense has been committed, may legally destroy evidence. Richard contends, however, that “if they waited until the statute of limitations expired ... the agreement would be fully and lawfully performed.” We reject the notion that once the statute of limitations on the state wire tap law runs, destruction of the tapes would no longer violate § 37.09(d)(1), and, therefore, could not be characterized as an illegal act.
6
Richard’s argument incorrectly assumes that the mere passage of time transforms an illegal act into a legal one. The statute of limitations is an affirmative defense; it does not bar prosecution for violation of a statute.
See Proctor v. State,
Nevertheless, Richard argues the court abused its discretion in refusing to eliminate any illegal provision and enforce the remainder of the settlement agreement. As a general rule, where part of the consideration for an agreement is illegal, the entire agreement is void if the contract is entire and indivisible.
See Montgomery,
Richard argues that the resolution of the various issues related to divorce, not the destruction of the tapes, was the essential purpose of the settlement agreement. In contrast, Luckmi argues that the destruc *314 tion of the tapes was the consideration for her release of claims against Richard and, thus, was an essential purpose of the agreement. Given the structure of the settlement agreement and its interrelated terms and provisions, we cannot say that the trial court acted without reference to guiding rules and principles in concluding that the agreement is entire and indivisible. Because the court found part of the consideration for the settlement agreement illegal, it was justified in finding the entire agreement void and unenforceable. Therefore, we find the trial court did not abuse its discretion by declaring the entire agreement void and refusing to enforce it.
Lastly, Richard argues that Luckmi is estopped from questioning the agreement’s validity because she accepted a $1000 cash payment under its terms. A void contract cannot be rendered enforceable by estoppel.
See Reyes v. Storage & Processors, Inc.,
Conclusion
In conclusion, we recognize that there are competing public policy interests at stake here. On the one hand, courts are responsible for carrying out this state’s policy of encouraging the peaceable resolution of disputes involving the parent-child relationship through voluntary settlement procedures.
See
Tex. Civ. Prag. & Rem. Code Ann. §§ 154.002, 154.003 (Vernon 1997). On the
other
hand, public policy prohibits courts from enforcing illegal contracts.
See Lewis,
Notes
. The copy of the mediated settlement agreement provided by Richard is neither file-stamped nor signed by the court. Nevertheless, the reporter's record from a later hearing establishes that the court signed and approved the agreement.
. Luckmi objects to the documents included in the appendix to the petition. These were the only documents provided in support of mandamus relief. A petition for writ of mandamus must contain an appendix, which must include “a certified or sworn copy of any order complained of, or any other document showing the matter complained of.” See Tex. R.App. P. 52.3(j). The orders of which Richard complains are included in the appendix and appear to be signed by the trial court, but are not file-stamped. The verification of Richard’s counsel states only "that the pleadings contained in the appendix are true and correct copies.” While the verification makes no mention of "orders, motions or other documents,” we construe "pleadings” in this instance to include all the documents in the appendix.
.
Spinks v. Spinks,
. Luckmi testified that after filing for divorce, she discovered a recording device attached to a phone in the garage of the house where she and Richard lived. She testified that the device also contained a tape of her conversations with others including, her mother, Shivi, and friends. Luckmi testified that she was unaware of the recording device or the tape and that she did not give permission to anyone to record her conversations. Luckmi also testified that when she confronted Richard, he acknowledged installing the device and making the recordings. When Richard was questioned on this topic, his counsel invoked the Fifth Amendment on Richard's behalf and instructed him not to answer.
. These non-parties include Shivi. Under the settlement agreement, Richard agreed to re *313 lease Shivi of all claims, except for child support. However, the release was conditioned on Shivi releasing claims against Richard.
. We note that § 37.09(d)(1) applies to the destruction of evidence that might be used in “any subsequent investigation or official proceeding” and is not limited to a violation of the state wire tap laws.
