
287 S.W.3d 65 (2008)
Amber LOVILL, Appellant,
v.
The STATE of Texas, Appellee.
Ex parte Amber Lovill.
Nos. 13-07-00529-CR, 13-07-00668-CR.
Court of Appeals of Texas, Corpus Christi-Edinburg.
December 22, 2008.
Discretionary Review Granted May 6, 2009.
Rehearing Overruled January 29, 2009.
*69 Brian C. Miller, Royston, Rayzor, Vickery & Williams, Corpus Christi, for appellant.
Carlos Valdez, Dist. Atty., Douglas K. Norman, Asst. Dist. Atty., Corpus Christi,
Before Chief Justice VALDEZ and Justices GARZA and BENAVIDES.

OPINION
Opinion by Justice BENAVIDES.
This case involves a claim of selective prosecution based on gender. Appellant, Amber Lovill, argues that the Nueces County District Attorney's Office selectively prosecuted her, seeking to revoke her probation and to incarcerate her in a drug-treatment facility because she was using drugs during her pregnancy. In cause number 13-07-529-CR, Lovill appeals the trial court's order modifying her probation and imposing sanctions for violating the terms of her probation. In cause number 13-07-668-CR, Lovill appeals the denial of her petition for writ of habeas corpus based on the same order. We have consolidated the two appeals and consider them together. We dismiss Lovill's direct appeal from the order modifying her probation for lack of jurisdiction. We reverse the trial court's order denying her petition for writ of habeas corpus and remand for further proceedings consistent with this opinion.

I. BACKGROUND

A. Underlying Offense and Probated Sentence
On November 15, 2001, Lovill was indicted on two counts of felony forgery resulting from checks she forged.[1]See TEX. PENAL CODE ANN. § 32.21 (Vernon 2003 & Supp.2008). On January 10, 2005, Lovill entered into a plea bargain with the State and pleaded guilty. In accordance with the plea agreement, the trial court assessed a punishment of two years in state jail, a $1,000 fine, $700 in restitution, and costs; however, the court suspended the prison term and placed Lovill on community supervision for three years. See TEX.CODE CRIM. PROC. ANN. art. 42.12, § 3 (Vernon 2006 & Supp.2008). As one of the conditions of Lovill's probation, she was required to "[a]void injurious or vicious habits and[/]or, avoid the use of alcoholic beverages, narcotics or any other controlled substances and submit to testing/blood analysis/urinalysis as directed for alcohol or controlled substances...." See id. art. 42.12, § 11(a)(2), (14) (Vernon Supp.2008). Lovill was also ordered to participate in a substance abuse program, report weekly to her probation officer, and to "satisfactorily participate in a screening/assessment for substance abuse and submit to any counseling, urinalysis, and/or diversionary program as determine [sic] within the [Community Supervision and Corrections Department ("CSCD")] TREATMENT ALTERNATIVE TO INCARCERATION PROGRAM...." See id. art. 42.12, § 13(f) (Vernon Supp.2008).

B. First Motion to Revoke
On September 16, 2005, the State filed a motion to revoke Lovill's probation. CSCD filed with an "Adult Probation Violation Report" with the district attorney's office. The reports alleges several violations of Lovill's probation: (1) On April 15, 2005 and May 19, 2005, Lovill's urinalysis tested positive for amphetamine; (2) Lovill *70 did not report to her CSCD officer weekly during months of May, June, July, and August 2005; (3) Lovill failed to pay costs, fines, restitution, and fees; and (4) Lovill failed to participate in a screening or assessment for substance abuse because on May 31, 2005, she was discharged from Coastal Bend Outpatient Services due to non-attendance.
On February 2, 2006, Lovill entered another plea bargain with the State and pleaded true to several of the counts in the motion to revoke. The trial court found that Lovill violated her probation on the counts she admitted, and on February 13, 2006, the trial court issued an "Order Imposing Sanctions on Defendant And Continuing or Modifying Probation." This order required Lovill to serve a term of confinement and treatment in the Nueces County Substance Abuse Treatment Facility ("SATF") for an indeterminate term of six to twelve months, and after release, to participate in drug or alcohol abuse continuum of care treatment plan. Lovill then went to SATF and remained there until February 8, 2007.

C. Second Motion to Revoke
On July 17, 2007, the State filed a second motion to revoke Lovill's probation. The motion alleged that Lovill: (1) submitted a urine sample that was positive for amphetamines on July 10, 2007; (2) failed to report for an office visit in June 2007; (3) failed to attend her SATF after-care classes; and (4) failed to pay fines, restitution, costs, and fees. On August 6 and 7, 2007, at a hearing on the motion to revoke, Lovill admitted the violations alleged, and the court accepted her pleas of true.
The State called Sandra Garza to testify. Garza is a CSCD officer for Nueces County who was assigned to supervise Lovill a "couple of weeks" prior to the hearing. Garza recommended to the court that Lovill be sanctioned to the Substance Abuse Felony Punishment Facility ("SAFPF") special needs unit. When asked why, Garza answered, "Ms. Lovill has relapsed. She has continued using drugs. On her last [urinalysis], she was positive. She is positive almost three times. The cutoff is a thousand, and she scored at 3,695 for amphetamine." The following exchange then occurred between Garza and the prosecutor:
Q: You say special needs. Special needs unit of S.A.F.P.F. Why special needs?
A: Ms. Lovill is pregnant.
Q: She is currently pregnant?
A: Yes.
On cross-examination, Lovill's counsel explored the reason that CSCD sought to revoke Lovill's probation:
Q: Ms. Garza, if Ms. Lovill wasn't pregnant, would the probation, as a probation, would you have considered revoking her at all?
A: We would need to have staffed her had she not been pregnant, but her being pregnant was a very high concern of ours.
Q: So basically it wasn't so much her doing drugs, it was the fact that since she was pregnant that you filed this motion to revoke, is that correct?
A: On some cases we have worked with individuals who have submitted positive UAs.
Q: How come you weren't willing to work with Ms. Lovill?
A: She's pregnant....
Q: So basically, if she had been given the opportunity to make up those [after-care] classes, there wouldn't have been a violation?

*71 A: No. The mainI think what drove this violation report was the positive [urinalysis] and her being pregnant.
The State then rested, and Lovill took the stand. She testified that she would like to go to CASA, which is an outpatient drug treatment facility. She requested that the court continue her on probation with a sanction of CASA or additional jail time added to the probated sentence. She claimed that she wanted to go to outpatient treatment so she could keep the baby with her. Her attorney then argued:
It is obvious the probation would have worked with her, but for the fact that she was pregnant and they decide to revoke her and then send her off to SAFP without even giving Ms. Lovill an opportunity to maybe work with probation even though she is pregnant. She is willing to go to CASA or some other treatment facility that is local; so she can have her baby and not have to go to prison, Your Honor. She had like a year left or so on her probation, so she would like to try and finish out her probation and put this case behind her. She understands that that was poor judgment in her case with the testing positive for amphetamines. In the alternative, if the Court sees fit to revoke her, she would like to do one year and not have to go to SAFP at all.
Counsel for the State argued that Lovill had a serious drug problem. Specifically, the State argued that:
not only is her problem with drugs continuing to be a danger to her, now it is a danger to her unborn child. She needs proper drug treatment in a secure environment and S.A.F.P.F. is a program that will provide that for her.... And also to give her time to address her drug problem and ensure that she is not going to be using drugs during the term of her pregnancy.
Lovill's counsel then argued that the State "would not even have revoked her, even with the positive UA, but for the fact that she was pregnant; they would have continued to work with her." Lovill's counsel asked that the probation department continue to work with her and "give her a chance," reiterating that "the probation would have worked with her, but for the fact that she is pregnant, they would have kept her on probation."[2]
The trial court disagreed with Lovill's counsel that the State sought to revoke her probation because she was pregnant: "Well, I think the fact that she tested positive is the reason we are all here, right, not for the fact that she is pregnant." On August 13, 2007, the trial court issued an "Order Imposing Sanctions on Defendant and Continuing or Modifying Probation." The court extended Lovill's probation by one year so that it now expires on January 10, 2009. The court further ordered Lovill to serve an indeterminate term of three to twelve months confinement and treatment in SAFPF.

D. Lovill's Motion for New Trial
On August 30, 2007, Lovill filed a motion for new trial, which she amended on September 5, 2007. Lovill asserted that the motion to revoke probation should have been dismissed because she was selectively prosecuted based on her gender and in violation of her right to privacy. She argued that the prosecution of the motion to revoke violated her rights under the Due Process and Equal Protection Clauses of the Fourteenth Amendment of the United States Constitution; the Equal Rights *72 Amendment of article I section 3a of the Texas Constitution; and the Due Process Clause of article I section 19 of the Texas Constitution. See U.S. CONST. amend. XIV; TEX. CONST. art. I, §§ 3a, 19.
On October 4, 2007, the trial court held a hearing on the motion for new trial. First, Lovill called Sandra Garza back to the stand. Garza testified that when a violation of probation occurs, the Nueces County CSCD determines whether to proceed with a probation review or to file a "violation report" with the district attorney's office. Garza testified that in a probation review, CSCD schedules an appointment with the judge overseeing the case to discuss the problems with a judge. In contrast, if CSCD sends a "violation report" to the district attorney's office, "it turns into a motion to revoke." Garza testified that the district attorney's office typically relies on CSCD to report probation violationsit does not conduct its own investigation.
Garza stated that CSCD has discretion to send, or not to send, a violation report to the district attorney's office: "It is usually on a case-by-case basis. If a problem arises, we staff the case with our supervisor. At that time, we determine whether to proceed with a probation review or a violation report." Garza admitted that the department has discretion to refuse to send a violation report to the district attorney's office even if the person on probation fails a urinalysis. She testified that CSCD considers "how the person is currently doing at the time that the problem is occurring; whether it is a positive [urinalysis] or failure to report. We take into consideration how they have done in the past, any extenuating circumstances like a pregnancy, stuff like that; whether there are any new arrests, stuff like that."
Garza then discussed Lovill's pregnancy:
Q: Why was her being pregnant a high concern?
A: Because of the positive urinalysis that she provided on July 10th. It was three times over theit was close to three times over the cutoff limit.
Q: In light of her pregnancy, what made the high urinalysis result a concern to you?
A: Well, we were concerned for the baby. We were concerned that she would continue using.
When questioned further about the reasons for seeking to revoke Lovill's probation, Garza testified as follows:
Q: And what was said during that discussion about reasons for terminating or requesting revocation of probation?
A: [Garza's supervisors] took into consideration the levels on your positive urinalysis. It was more than three times the cutoff and that she was pregnant.
Q: Would that, according to what [the supervisors] said to you, would that violation report have been sent to the DA's office if she were not pregnant?
A: I don't know. We would have to take into consideration how she was doing. If she wasn't pregnant, it is probable that a review would have been scheduled, I'm not certain.
Q: From your review of the case file on August 6th, do you belive [sic] that her pregnancy was a factor that caused a motion to revoke to be filed?
A: Yes.
Q: Do you belive [sic], based on the review that you did in preparation for the August 6th hearing, that a motion to revoke would have been filed if she had not been pregnant?

*73 A: I can'tI don't know whether a violation report would have been filed; in all likelihood maybe we would have proceeded with a review.
J.D. Vargas, a probation officer at Nueces County CSCD, also testified. He was assigned to Lovill's case from May 29, 2007 until the violation report was filed. He testified that he worked on the case with his supervisor, Tom Lavers. Vargas testified that when he met with Lovill, she told him she was pregnant and was very upset. Vargas claimed that Lovill was so upset that he could not calm her down himself, so he recruited Garza to work on the case. He claimed that he was concerned that she was emotionally unstable.
Vargas admitted that Lovill's pregnancy was a factor that entered into the decision to revoke Lovill's probation:
Q: Was pregnancy a factor that entered into the termination here?
A: First and foremost the concern was her use of methamphetamine. It was a very high level. Secondly, yes, there is a concern, coupled with that, there is a concern for the overall health of herself, as well as the unborn child.
Q: What options did you have at your disposal, other than sending a violation report to the DA's office?
A: I didn't feel I had any other options.
Q: Why?
A: Because of her overall well being, as well as the health and well being of her unborn child.
Q: If she were not pregnant, what options would you have had?
A: If she was not pregnant, there is the possibility that we would have allowed the warrant to either go through the normal channels. There is a possibility that we may have conducted a review before the Court to discuss where to go from there.
....
Q: When somebody has a positive urinalysis for methamphetamine, is that something that automatically results in a violation report going to the D.A.'s office?
A: Every case differs from case to case. Methamphetamine, from what I understand, is a very powerful drug. It is a strong addiction. There is definitely a need to get assistance for that person immediately. The cases vary from case to case. So I can't speakyou know, I can't specifically state that everything is going to be the same with what we would do. We may have a person report, in my case, the following week to see how that [urinalysis] comes out, see if the levels are coming down. If not, then it is very apparent that this person is not going to stop using, so we definitely have to file a violation report.
Defense counsel questioned Vargas about a document created by CSCD entitled, "Chronological Record of Contacts for Lovill, Amber." On July 17, 2007, there is an entry that reads: "Phoned and spoke to Lieutenant Ashley at Warrants and asked to see if he may be able to have an officer attempt to have defendant arrested since she is consuming methamphetamines and is 5 months pregnant. J.D. Vargas." Vargas admitted that he wrote the entry. Defense counsel asked Vargas if he would have called Lieutenant Ashley had Lovill not been pregnant. Vargas stated, "In all likely, no."
The trial court denied Lovill's motion for new trial on October 4, 2007. On October 11, 2007, Lovill filed a motion to amend the conditions of Lovill's probation. The trial *74 court denied this motion on October 12, 2007. Lovill then appealed the order revoking her probation and imposing sanctions for violating the terms of her probation. That appeal has been docketed as appellate cause number 13-07-529-CR.

E. Lovill's Petition for Habeas Corpus
Lovill then filed a petition for writ of habeas corpus with the trial court seeking relief from the trial court's order increasing the term of probation and sentencing Lovill to a term of confinement in SAFPF.[3] Lovill asked the court to take judicial notice of the prior hearings, and she argued that she was selectively prosecuted. On October 18, 2007, without holding a hearing, the trial court denied the petition. The trial court made a single finding of fact: "The prosecution of the motion to revoke probation that was filed on or about July 17, 2007, in Cause No. 01-CR-3725-A did not occur because of Amber Lovill's pregnancy." The trial court also made a single conclusion of law: "Amber Lovill's selective prosecution defense required proof that the prosecution of the motion to revoke probation occurred because of her pregnancy." Lovill appealed the denial of her petition for writ of habeas corpus, which has been docketed as appellate cause number 13-07-668-CR. We have consolidated the two appeals and decide them both herein.

II. APPELLATE JURISDICTION
The State urges the Court to dismiss Lovill's appeal from the order modifying the conditions of her community supervision. The State argues that there is no legislative authority for entertaining a direct appeal from an order modifying the conditions of community supervision. See Davis v. State, 195 S.W.3d 708, 710 (Tex. Crim.App.2006); Basaldua v. State, 558 S.W.2d 2, 5 (Tex.Crim.App.1977); see also Hernandez v. State, No. 13-07-263-CR, 2007 WL 1775809, at *1 (Tex.App.-Corpus Christi June 21, 2007, no pet.) (mem. op., not designated for publication). Lovill recognizes that ordinarily, an order modifying conditions of probation is not a separately appealable order. However, Lovill states that she filed the appeal out of an abundance of caution because habeas corpus relief under Texas Code of Criminal Procedure article 11.072 is available only in the absence of a direct remedy by appeal. See TEX.CODE CRIM. PROC. ANN. art. 11.072, § 3(a) (Vernon 2005). We agree that we lack jurisdiction over Lovill's direct appeal from the order modifying the conditions of her community supervision. See Davis, 195 S.W.3d at 710; Basaldua, 558 S.W.2d at 5. Accordingly, we dismiss appellate cause number 13-07-529-CR for lack of jurisdiction. We will address Lovill's arguments in the context of her request for habeas corpus relief. See Basaldua, 558 S.W.2d at 5 ("We conclude that the imposition of conditions of probation that contain unconstitutional infringements of freedom of action constitutes a `restraint' within the scope of habeas corpus relief.").

III. WAIVER OF COMPLAINTS
Before we reach the merits, we must address two waiver arguments raised by the State. First, the State argues that by pleading true to the allegations in the motion to revoke, Lovill waived her selective prosecution claim. Second, the State argues that Lovill waived her selective prosecution claim by failing to timely object at the August 6, 2007 hearing on the State's *75 motion to revoke. We disagree with both arguments.

A. No Waiver by Plea of True
The State argues that a plea of "true" to a motion to revoke probation waives any non-jurisdictional defects that occurred before the plea was entered, when "the judgment of guilt was rendered independent of, and is not supported by, the error." See Young v. State, 8 S.W.3d 656, 666-67 (Tex.Crim.App.2000); Jordan v. State, 112 S.W.3d 345, 347 (Tex.App.-Corpus Christi 2003, pet. ref'd). The State argues that we must analyze whether the error has a "direct nexus" with Lovill's guilt or innocence and base our finding of waiver solely on the outcome of this analysis. The State reasons that because selective prosecution is not a defense to the merits of the charged conduct, Lovill's claim of selective prosecution has no connection to her guilt. Thus, according to the State, the order modifying Lovill's probation was rendered independently of any error by the State in selectively prosecuting Lovill, and her plea of true waives any error.
The State misunderstands the meaning of Young and its application in the present context. In Young, the defendant pleaded guilty after the trial court denied a motion to suppress evidence. 8 S.W.3d at 657. The court of appeals applied the Helms rule and held that the defendant waived her right to complain of the trial court's ruling by pleading guilty. Id. At the time, the Helms rule applied as follows: "Where a plea of guilty is voluntarily and understandingly made, all non-jurisdictional defects including claimed deprivation of federal due process are waived." Id. at 660 (citing Helms v. State, 484 S.W.2d 925, 926 (Tex.Crim.App.1972)).
The court of criminal appeals reviewed the history of the Helms rule, and it determined that over time, the rule had been distorted from its original justifications. Id. at 657, 666. The court explained that the original basis for the Helms rule was that a defendant's guilty plea is conclusive as to a defendant's guilt. Id. at 660-61. As the court explained, given this rationale for the rule, "the rule would not justify forfeiture of claims of error that do not go to the question of guilt, such as denials of motions to dismiss because the penal statute was invalid or the period of limitation had expired." Id.
After reviewing the rule's history, the court concluded that in order to remain true to the rule's original justification, a plea of guilty should only waive errors that are independent of the guilty plea "[w]hether entered with or without an agreed recommendation of punishment by the State, a valid plea of guilty or nolo contendere `waives' or forfeits the right to appeal a claim of error only when the judgment of guilt was rendered independent of, and is not supported by, the error." Id. at 666-67.
As in Young, the suppression of evidence can relate directly to the defendant's guilt, and a guilty plea may not be independent of a trial court's ruling on the motion to suppress depending on the type of evidence and the crime alleged. See id. at 667 ("In this case the judgment of guilt is not independent of the trial court's ruling on the motion to suppress the evidence of the offense, and the judgment would not be supported without that evidence."); Jordan, 112 S.W.3d at 347. Thus, in suppression cases, the court must determine if the evidence suppressed would have been required to establish the defendant's guilt. See Kennedy v. State, 262 S.W.3d 454, 457-59 (Tex.App.-Austin 2008, no pet. h.). In other words, if a direct nexus exists between the evidence and the defendant's guilt, a guilty plea will not waive error in *76 failing to suppress the evidence. See id. at 458. If the evidence to be suppressed would not be required to establish the defendant's guilt, then it can be said that the error in refusing to suppress the evidence is independent of a the defendant's subsequent guilty plea. See id.
However, contrary to the State's argument, the fact that a selective prosecution claim does not involve the defendant's guilt or innocence does not end the inquiry and require a finding of waiver in the State's favor. A selective prosecution claim is more akin to a denial of a motion to dismiss because the penal statute is invalid or the period of limitation had expired, which as the court of criminal appeals recognized, would not be waived by a guilty plea even though the claimed error does not go to the question of guilt. Young, 8 S.W.3d at 660. Thus, we must focus on the actual inquiry required by Young, which is whether the judgment was rendered independent of the claimed error. Id. at 667; see Jordan, 112 S.W.3d at 347.
The State has not cited any Texas case that has refused to consider a selective prosecution claim because of a guilty plea or a plea of "true" in a revocation proceeding. There are none. However, logic requires the conclusion that Lovill's plea of true was not independent of the State's alleged selective prosecution. Obviously, there would have been no reason for Lovill to plead "true" if the motion to revoke had never been filed. And according to Lovill, if it were not for the CSCD's selective prosecution of her based on her pregnancy, no motion to revoke would have been filed. Thus, her plea of "true" was not independent of the alleged selective prosecution, and the plea of "true" did not waive the error. Cf. Jordan, 112 S.W.3d at 347 (finding error waived because there was no evidence that defendant would not have pleaded guilty absent counsel's deficient performance).

B. Timeliness of objection
Second, the State argues that Lovill did not timely present her selective prosecution claim because she did not object during the August 6, 2007 revocation hearing. We disagree.
At the August 6 hearing, Lovill's counsel repeatedly told the court that the State was prosecuting Lovill because she was pregnant and asked that Lovill be treated the same as a non-pregnant offender. The State responded to this argument. The court understood the argument and stated on the record its disagreement: "Well, I think the fact that she tested positive is the reason we are all here, right, not for the fact that she is pregnant." Because everyone at the hearing understood the substance of Lovill's complaint, including the trial court, we conclude that the issue was preserved. Winkfield v. State, 792 S.W.2d 727, 731 n. 1 (Tex.App.-Corpus Christi 1990, pet. ref'd) ("To the extent that an appellate record adequately shows that the trial judge and opposing counsel were aware of the substance of a defendant's objection, thereby meeting the purpose of an objection, an objection preserves the complaint for appellate review.").
Moreover, a selective prosecution claim can be raised at various times during a criminal proceeding. For example, it may be raised in a motion to quash the indictment. See Covalt v. State, 877 S.W.2d 445, 446 (Tex.App.-Houston [1st Dist.] 1994, no pet.). It can also be raised in a motion for new trial. Satterwhite v. State, 726 S.W.2d 81, 84 (Tex.Crim.App. 1986) (reviewing selective prosecution claim raised in motion for new trial), rev'd on other grounds, 486 U.S. 249, 108 S.Ct. *77 1792, 100 L.Ed.2d 284 (1988); see also Galvan v. State, 988 S.W.2d 291, 295 (Tex. App.-Texarkana 1999, pet. ref'd).
After the trial court sanctioned Lovill to SAFPF, Lovill moved for a new trial, alleging selective prosecution. The trial court held a hearing, and the issue was extensively litigated. Moreover, Lovill moved to modify the conditions of her probation and then filed her petition for writ of habeas corpus, making the same arguments. See TEX.CODE CRIM. PROC. ANN. art. 11.072, § 3(b). Lovill took every opportunity to make her complaints known to the trial court, and the court clearly understood and ruled on the issue. Lovill's issue is preserved for our review. Satterwhite, 726 S.W.2d at 84; see also Galvan, 988 S.W.2d at 295.
As a corollary, and without citing any authority, the State argues that Lovill waived her complaints because she asked to be sanctioned by being placed in the CASA program or by additional jail time. The State reasons that "at best, Lovill simply failed to object, and, at worst, she affirmatively asked to be sanctioned and her conditions to be modified, though she was not ultimately sanctioned in the exact manner she desired." We disagree that Lovill's request to be sent to an outpatient treatment facility or to add time to the probated sentence affirmatively waived her right to assert a claim of selective prosecution. "A waiver is ordinarily an intentional relinquishment or abandonment of a known right or privilege." Leday v. State, 983 S.W.2d 713, 718 (Tex.Crim.App. 1998) (quoting Johnson v. Zerbst, 304 U.S. 458, 464, 58 S.Ct. 1019, 82 L.Ed. 1461 (1938)). When constitutional rights are at stake, we must indulge every reasonable presumption against a waiver of those rights. Stringer v. State, 241 S.W.3d 52, 56 (Tex. Crim.App.2007). Because her goal was to keep her baby after its birth, Lovill requested these options as an alternative to the State's proposal to send her to a lockdown facility because her goal was to remain with her baby after its birth. Her requests were not inconsistent with her request to dismiss the prosecution, which would have also achieved the same goal of keeping Lovill with her baby after birth. Accordingly, Lovill did not affirmatively waive her selective prosecution claim.

IV. EQUAL PROTECTION
Lovill argues that the State selectively prosecuted her based on her gender in violation of the Equal Protection Clause of the United States Constitution and the Equal Rights Amendment to the Texas Constitution ("ERA"). See U.S. CONST. amend. V, XIV; TEX. CONST. art. I, § 3a ("Equality under the law shall not be denied or abridged because of sex, race, color, creed, or national origin. This amendment is self-operative."). The State disputes nearly every facet of Lovill's claims. First, the State argues that Lovill failed to demonstrate that the violation report was filed and that the conditions of Lovill's probation were modified because of her pregnancy. Second, the State argues that even if pregnancy was a factor, it did not amount to gender-based discrimination. Finally, even if it discriminated based on gender, the State argues that such discrimination was justified. The parties agree that Lovill's federal constitutional claim is subject to intermediate scrutiny, which requires that the State demonstrate that the discriminatory classification is substantially related to an important governmental interest. Casarez v. State, 913 S.W.2d 468, 473 (Tex.Crim.App.1994). However, the parties dispute the type of review that applies to gender-based distinctions under the Texas Equal Rights Amendment ("ERA"). TEX. CONST. art. I, § 3a.


*78 A. Standard of Review in Habeas Corpus Appeals
In this case, the trial court ruled on the merits of Lovill's petition for writ of habeas corpus. See Tex.Code Crim. Proc. art. 11.072, § 7(a). We review the trial court's decision to grant or deny habeas relief for abuse of discretion. Ex parte Wilson, 171 S.W.3d 925, 928 (Tex. App.-Dallas 2005, no pet.). "[W]e view the facts in the light most favorable to the trial court's ruling." Id. (citing Ex parte Peterson, 117 S.W.3d 804, 819 (Tex.Crim.App. 2003) (per curiam), overruled in part on other grounds, Ex parte Lewis, 219 S.W.3d 335, 371 (Tex.Crim.App.2007)). We must afford almost total deference to the judge's determination of the historical facts that are supported by the record, particularly if the fact findings are based on an evaluation of credibility and demeanor. Id. If the resolution of the ultimate questions of law turns on an evaluation of credibility and demeanor, we will likewise defer to the trial court's resolution of the legal issue. Id. "If the resolution of the ultimate questions turns on an application of legal standards, we review the determination de novo." Id.

B. Selective Prosecution Generally
Prosecutors enjoy significant discretion in their prosecutorial decisions. United States v. Armstrong, 517 U.S. 456, 464, 116 S.Ct. 1480, 134 L.Ed.2d 687 (1996); Neal v. State, 150 S.W.3d 169, 173 (Tex.Crim.App.2004); County v. State, 812 S.W.2d 303, 308 (Tex.Crim.App.1989); Carreras v. State, 936 S.W.2d 727, 730 (Tex.App.-Houston [14th Dist.] 1996, pet. ref'd). Generally, "`[i]f the prosecutor has probable cause to believe that the accused committed an offense defined by statute, the decision whether to prosecute and what charge to file generally rests entirely within his or her discretion.'" Neal, 150 S.W.3d at 173 (quoting State v. Malone Serv. Co., 829 S.W.2d 763, 769 (Tex.1992)); see Armstrong, 517 U.S. at 464, 116 S.Ct. 1480. Because of this discretion, there is a presumption that a prosecutor has acted within his or her duties and in good faith. Armstrong, 517 U.S. at 464, 116 S.Ct. 1480; Roise v. State, 7 S.W.3d 225, 243 (Tex.App.-Austin 1999, pet. ref'd).
Prosecutorial discretion, however, is not absoluteprosecutors are constrained by the constitution. Armstrong, 517 U.S. at 464, 116 S.Ct. 1480; County, 812 S.W.2d at 308; Roise, 7 S.W.3d at 243. For example, the Equal Protection Clause prohibits prosecutorial decisions based on "an unjustifiable standard such as race, religion, or other arbitrary classification." Armstrong, 517 U.S. at 464, 116 S.Ct. 1480 (quoting Oyler v. Boles, 368 U.S. 448, 456, 82 S.Ct. 501, 7 L.Ed.2d 446 (1962)); Green v. State, 934 S.W.2d 92, 103 (Tex.Crim. App.1996). To overcome the presumption of regularity that attaches to prosecutorial decisions, a criminal defendant must make an "exceptionally clear" showing of an Equal Protection violation. Armstrong, 517 U.S. at 464, 116 S.Ct. 1480; Green, 934 S.W.2d at 103.
Ordinary standards for equal protection claims apply in the context of selective prosecution.[4]Armstrong, 517 *79 U.S. at 465, 116 S.Ct. 1480; Carreras, 936 S.W.2d at 730. The defendant must show that the prosecutorial policy had a discriminatory effect and that it was motivated by a discriminatory purpose. Armstrong, 517 U.S. at 465, 116 S.Ct. 1480; Carreras, 936 S.W.2d at 730. First, to show discriminatory effect, the defendant must demonstrate that although others that are not part of the protected class have not been prosecuted for the same conduct, he or she was singled out for prosecution. See Armstrong, 517 U.S. at 465, 116 S.Ct. 1480 ("To establish a discriminatory effect in a race case, the claimant must show that similarly situated individuals of a different race were not prosecuted."); Carreras, 936 S.W.2d at 730. Second, to demonstrate that the prosecution was motivated by a discriminatory purpose, the defendant must show that the government's selection of the defendant for prosecution was based on an impermissible consideration, such as race, religion, or the desire to prevent the exercise of constitutional rights. Wayte v. United States, 470 U.S. 598, 610, 105 S.Ct. 1524, 84 L.Ed.2d 547 (1985). Once the defendant makes a clear showing of an Equal Protection violation, the burden shifts to the State to justify the discriminatory treatment. See Johnson v. California, 543 U.S. 499, 505, 125 S.Ct. 1141, 160 L.Ed.2d 949 (2005) (holding that the State had burden to show that race-based classifications satisfied strict scrutiny analysis).

C. Discriminatory Effect and Purpose
Lovill contends that the trial court erred by finding that the prosecution of the motion to revoke "did not occur because of Amber Lovill's pregnancy." Lovill argues that the probation officers' testimony established that CSCD initiates the prosecution of pregnant women for probation violations in situations where the CSCD would not make the same recommendation if the defendant were male or a nonpregnant female. Lovill also asserts that the CSCD officers admitted that her pregnancy was a motivating factor in the decision to prosecute her.
The State argues that Lovill was prosecuted because she violated the terms of her probation and because she appeared emotionally unstable when she reported to her probation officers, not because she was pregnant. In other words, the State argues that Lovill's claim must fail because she was guilty of violating her probation. However, the guilt or innocence of the defendant is irrelevant to the claim of selective prosecution. Armstrong, 517 U.S. at 463, 116 S.Ct. 1480; Galvan, 988 S.W.2d at 295. Thus, the fact that the State could have prosecuted Lovill for violating her probation does not matterthe relevant inquiry is whether the State would have prosecuted her absent the impermissible consideration of her pregnancy.
The trial court's sole conclusion of law was that Lovill's selective prosecution claim required proof that she was prosecuted "because of" her pregnancy. It found as a matter of fact that Lovill was not prosecuted "because of" her pregnancy. It appears that the trial court failed to recognize that in a selective prosecution claim, the discriminatory purpose need not be the only purpose for the prosecution. Rather, the discriminatory purpose must merely be a "motivating factor" for the decision to prosecute. See Wayte, 470 U.S. at 610, 105 S.Ct. 1524 ("`[D]iscriminatory purpose' ... implies that the decisionmaker... selected or reaffirmed a particular course of action at least in part *80 `because of,' not merely `in spite of,' its adverse effects upon an identifiable group."); Vill. of Arlington Heights v. Metro. Hous. Dev. Corp., 429 U.S. 252, 265-66, 97 S.Ct. 555, 50 L.Ed.2d 450 (1977);[5]Marshall v. Columbia Lea Reg'l Hosp., 345 F.3d 1157, 1168 (10th Cir.2003); United States v. Alameh, 341 F.3d 167, 173 (2d Cir.2003).
The State argues that the CSCD officers' testimony at the hearing was purely speculative and merely showed a possibility that the department would not have filed a violation report if Lovill had not been pregnant. As Lovill points out, we must defer to the trial court's findings of historical facts when they are supported by the record and when they depend on determinations of credibility and demeanor. Ex parte Wilson, 171 S.W.3d at 928. However, if the trial court's fact finding is not supported by the record, we may make contrary findings. See Ex parte Peterson, 117 S.W.3d at 819 n. 67; Ex parte Adams, 768 S.W.2d 281, 288 (Tex.Crim.App.1989).
The only evidence came from the State's witnesses, who admitted that they were not "willing to work with" Lovill to try alternative measures because of her pregnancy. Garza explained that CSCD has discretion whether to file a violation report with the district attorney's office. As she stated, once CSCD makes that decision and sends the report, it "turns into a motion to revoke." The district attorney's office relies on CSCD's determination and does not typically conduct its own investigation. She explained that there are alternatives to filing a violation report, such as proceeding with a probation review before a judge.
Garza testified that a violation report is not automatic when a person tests positive for drugsshe admitted that the department has discretion to refuse to send a violation report to the district attorney's office even if the probationer fails a urinalysis. She testified that the department considers the probationer's past and extenuating circumstances, such as pregnancy.
Garza testified that on some cases, CSCD has worked with individuals who tested positive for drugs. But CSCD was not willing to work with Lovill because she was pregnant. Garza testified that "what drove this violation report was the positive [urinalysis] and her being pregnant." Garza explained that her supervisors made the decision to revoke Lovill's probation, and that the supervisors "took into consideration the levels on your positive urinalysis. It was more than three times the cutoff and that she was pregnant."[6] From her review of the case file, she testified that pregnancy was a factor that caused the motion to revoke to be filed.
*81 Garza stated that had Lovill not been pregnant, a probation review may have been scheduled instead of a violation report being filed. Vargas admitted that absent the pregnancy, he "might have attempted a review and scheduled weekly visits to see how she is doing" and "more random [urinalysis] to see if the levels are coming down to see if she can do it on her own." Vargas admitted that the pregnancy "eliminated any doubt" about the decision he had to make. Contrary to the State's arguments, there is nothing speculative about any of this testimony.
Although a trial court has discretion to disregard uncontradicted testimony that it finds incredible and unworthy of belief, see Ex parte Peterson, 117 S.W.3d at 819 n. 68, we believe that to reach the finding it did, the trial court must have disregarded all of the evidence presented. In this case, the trial court was not free to disregard the overwhelming evidence presented at the hearing showing a discriminatory effect and purpose, which allowed only a single conclusion. We hold that the fact finding is not supported by the record. See id.; Ex parte Adams, 768 S.W.2d at 288. The evidence shows (1) that Lovill was treated differently than others who violated the terms of their probation but were not pregnant, and (2) that her pregnancy was a motivating factor in the decision to prosecute. Additionally, the trial court's conclusion that Lovill was required to show that she was prosecuted "because of" her pregnancy ignores the actual test for an Equal Protection claimall that is required is that the impermissible consideration be a motivating factor. See Wayte, 470 U.S. at 610, 105 S.Ct. 1524; Vill. of Arlington Heights, 429 U.S. at 265-66, 97 S.Ct. 555; Marshall, 345 F.3d at 1168; Alameh, 341 F.3d at 173. The evidence clearly establishes that it was.
Nevertheless, the State argues that the evidence showed that even if Lovill had not been pregnant, the State probably would have filed a probation review and taken her before a judge, which could have produced the same result. We disagree that this is a proper consideration. Courts cannot speculate whether the same outcome would have occurred absent the selective prosecution. See Vasquez v. Hillery, 474 U.S. 254, 264, 106 S.Ct. 617, 88 L.Ed.2d 598 (1986). As the Supreme Court said in Vasquez,
[j]ust as a conviction is void under the Equal Protection Clause if the prosecutor deliberately charged the defendant on account of his race, a conviction cannot be understood to cure the taint attributable to a charging body selected on the basis of race. Once having found discrimination in the selection of a grand jury, we simply cannot know that the need to indict would have been assessed in the same way by a grand jury properly constituted.
Id.
Finally, the State argues that even if pregnancy was a factor in the decision to prosecute, it did not discriminate against Lovill based on her gender. It argues that pregnancy causes added stress, anxiety, and physical sickness to the expectant mother, which makes it difficult to comply with conditions of probation and to maintain the willpower necessary to overcome a drug addiction. The State argues that Lovill asks the State to do the impossibleto disregard the biological and psychological symptoms of pregnancy even though those symptoms may effect her rehabilitation. The State cites no authority for its argument, which we believe is based on archaic and outdated views of pregnancy and of women. Even if the State acts with the intent of protecting a pregnant woman's health, it still may overstep *82 the boundaries of the constitution when its actions result in discriminatory treatment based on pregnancy. See, e.g., Cleveland Bd. of Educ. v. LaFleur, 414 U.S. 632, 641-48, 94 S.Ct. 791, 39 L.Ed.2d 52 (1974) (holding that a maternity leave policy was unconstitutional even though designed to protect pregnant woman's health). Accordingly, we sustain Lovill's first issue.

D. Justification
Lovill and the State both concede that under the United States Constitution, gender-based discrimination claims are evaluated under an intermediate scrutiny analysis. See Clark v. Jeter, 486 U.S. 456, 461, 108 S.Ct. 1910, 100 L.Ed.2d 465 (1988). Lovill argues, however, that the ERA elevated gender to the same level of protection as race, color, creed, or national origin; therefore, according to Lovill, we must apply a strict scrutiny analysis to her state constitutional claim, rather than an intermediate scrutiny analysis. The State argues that the less restrictive "rational basis" test applies to gender-based claims.
Our analysis of these arguments is hindered by the fact that the trial court never reached this issue. The trial court, in a habeas corpus proceeding, may review the applicant's petition without requesting a response from the State. TEX.CODE CRIM. PROC. art. 11.072, § 5(b). If the State does not file an answer, all allegations in the application are deemed denied. Id. art. 11.072, § 5(e). As is apparent from its finding of fact and conclusion of law, the trial court determined that Lovill did not meet her burden to establish an Equal Protection violation. Had the trial court correctly determined that Lovill met her burden, the burden would have then shifted to the State to justify its conduct under the appropriate level of scrutiny. See Johnson, 543 U.S. at 505, 125 S.Ct. 1141.
The record on this issue is wholly undeveloped and requires a hearing by the trial court. We are not in the position to decide these issues in the first instance. Accordingly, we reverse the trial court's denial of Lovill's petition for writ of habeas corpus and remand to the trial court. See Ex parte Cherry, 232 S.W.3d 305, 308 (Tex. App.-Beaumont 2007, pet. ref'd) (reversing and remanding denial of petition for writ of habeas corpus so that appropriate record could be developed); see also Ex parte Headrick, Nos. WR-65,676-01, WR-65,676-02, 2006 WL 2848147, at *1 (Tex.Crim. App.2006) (order) (holding that an appellate court is not equipped to make factual findings on review of denial of petition for writ of habeas corpus). On remand, the trial court should require the State to respond to Lovill's Equal Protection claim. It should determine the appropriate level of scrutiny that applies and take evidence on the application of that level of scrutiny in this case. Furthermore, the trial court is instructed to make specific findings of fact and conclusions of law setting out its rulings on whether the State meets its burden of proof to justify its discriminatory treatment of Lovill.

V. CONCLUSION
We dismiss Lovill's appeal from the order modifying the conditions of her probation for lack of jurisdiction. Because the trial court erred in finding that Lovill did not sustain her burden of showing an Equal Protection violation, we reverse the trial court's order denying Lovill's petition for writ of habeas corpus and remand to the trial court for further proceedings consistent *83 with this opinion.[7]
NOTES
[1]  The indictment was entered as trial court cause number 01-CR-3725-A, in the 28th District Court of Nueces County, Texas.
[2]  In the reporter's record, this statement is incorrectly attributed to the prosecutor. Both parties agree that the statement was made by Lovill's counsel, not the State.
[3]  This petition was filed as trial court cause no. 07-5690-A in the 28th District Court of Nueces County, Texas.
[4]  The State argues that Lovill's claim is really one for "selective enforcement," rather than for "selective prosecution," because Lovill was prosecuted and found guilty long before the present revocation proceeding. It argues that a community supervision revocation proceeding is neither a criminal nor a civil trial, but rather, an administrative proceeding, citing Cobb v. State, 851 S.W.2d 871, 873 (Tex. Crim.App.1993). However, the State does not assert that the standards applicable to a "selective enforcement" claim are any different than those applicable to a "selective prosecution" claim, and the State relies on selective prosecution cases throughout its brief. We see no difference between the two, and we will analyze Lovill's arguments under the case law applicable to selective prosecution claims.
[5]  As the Supreme Court recognized,

[r]arely can it be said that a legislature or administrative body operating under a broad mandate made a decision motivated solely by a single concern, or even that a particular purpose was the "dominant" or "primary" one. In fact, it is because legislators and administrators are properly concerned with balancing numerous competing considerations that courts refrain from reviewing the merits of their decisions, absent a showing of arbitrariness or irrationality. But racial discrimination is not just another competing consideration. When there is a proof that a discriminatory purpose has been a motivating factor in the decision, this judicial deference is no longer justified.
Vill. of Arlington Heights v. Metro. Hous. Dev. Corp., 429 U.S. 252, 265-66, 97 S.Ct. 555, 50 L.Ed.2d 450 (1977).
[6]  The State argues that this testimony is speculative because the defense never called Lavers, Garza's and Vargas's supervisor, to testify. The State does not cite any legal authority to support its argument that Lavers's testimony was required. Moreover, the State did not object to Garza's testimony at the hearing as speculative, as not based on her own personal knowledge, or as hearsay.
[7]  We do not reach Lovill's argument that the State's selective prosecution of her based on her pregnancy also impinged on her right to privacy in making child-bearing decisions. TEX.R.APP. P. 47.1. The trial court did not reach this issue and should consider it on remand.
