
139 P.3d 757 (2006)
143 Idaho 155
STATE of Idaho, Plaintiff-Respondent,
v.
Anthony K. THOMPSON, Defendant-Appellant.
No. 31305.
Court of Appeals of Idaho.
April 11, 2006.
Review Denied July 26, 2006.
*758 Molly J. Huskey, State Appellate Public Defender; Eric D. Fredericksen, Deputy Appellate Public Defender, Boise, for appellant. Eric D. Fredericksen argued.
Hon. Lawrence G. Wasden, Attorney General; Rebekah A. Cudé, Deputy Attorney General, Boise, for respondent. Rebekah A. Cudé argued.
GUTIERREZ, Judge.
Anthony K. Thompson appeals from the judgment entered upon his conviction for possession of methamphetamine. This case addresses whether constitutional error, due to the omission of an essential element defining the offense in the jury instructions, was harmless. We affirm.

I.

BACKGROUND
According to the state's evidence presented at trial, a mother contacted the Kootenai County Sheriff Office alleging that her daughter was being held against her will at the Coeur d'Alene home of Michael Mallett. *759 In response, two deputies approached the front door of the residence while a third deputy went around to the back door. From the alleyway at the rear of the house, the third deputy could see through a window into the kitchen and living room. One of the deputies knocked on the front door and a male voice answered, "Who is it?" The deputy at the window could see that Thompson was looking through the front door peephole and holding a hypodermic needle in his hand.
After the deputies identified themselves, Thompson left the front door area and walked toward the back of the house and out of sight. A deputy knocked on the front door again and Mallett eventually opened the door. Thompson emerged from the back room of the house and was frisked by a deputy who later testified that she found a bindle of what she suspected to be methamphetamine in the right front pocket of Thompson's sweat pants. Two baggies of crystal methamphetamine were also removed from Thompson's pockets. Thompson testified, however, that the sweat pants he was wearing did not have pockets and that the deputy only pulled keys out of the pockets of the shorts Thompson was wearing under the sweat pants.
While the pat-down search of Thompson was occurring, another deputy conducted a sweep of the house to determine if the person they were looking for was there. During the sweep, the deputy observed a yellowish crystal substance in a small baggie, packaging materials, scales, a burner, a spoon which appeared to have drug residue on it, a butane lighter, some pipes, and a large amount of currency in plain view near the back bedroom. Upon obtaining and executing a search warrant, deputies found a hypodermic needle floating in the toilet in the bathroom at the back of the house. The jury found Thompson guilty of possession of methamphetamine. This appeal followed.

II.

ANALYSIS
The elements instruction given to the jury did not include the requisite element that the state must prove that the defendant knew the substance possessed was a controlled substance.[1]See State v. Blake, 133 Idaho 237, 241-42, 985 P.2d 117, 121-22 (1999). Thompson argues that this error in the jury instructions violated his Sixth Amendment right to have a jury make a determination of guilt or innocence on all the disputed elements of the offense. The state concedes this was error but argues that the error was harmless.
The determination of error in the jury instructions does not end our inquiry where, as here, the state argues that the error was harmless. State v. Hansell, 141 Idaho 587, 591, 114 P.3d 145, 149 (Ct.App. 2005). To constitute error entitling a defendant to relief, an instruction must mislead the jury or prejudice the defendant. State v. Hanson, 130 Idaho 842, 844, 949 P.2d 590, 592 (Ct.App.1997). Any error, defect, irregularity, or variance that does not affect substantial rights shall be disregarded. I.C.R. 52. A harmless error analysis may be applied when a court omits an essential element from the instructions to the jury. Neder v. United States, 527 U.S. 1, 15, 119 S.Ct. 1827, 144 L.Ed.2d 35 (1999); State v. Lovelace, 140 Idaho 73, 79, 90 P.3d 298, 304 (2004). In cases where the improper instruction did not vitiate all the jury's findings, the United *760 States Supreme Court has "recognized that improperly omitting an element from the jury can easily be analogized to improperly instructing the jury on an element of the offense, an error which is subject to harmless-error analysis." Neder, 527 U.S. at 10-11, 119 S.Ct. 1827; State v. Peteja, 139 Idaho 607, 613, 83 P.3d 781, 787 (Ct.App.2003). See, e.g., State v. Lilly, 142 Idaho 70, 72, 122 P.3d 1170, 1172 (Ct.App.2005) (instruction submitted to the jury resulted in the omission of an element by effectively canceling out the essential element given in another instruction).
The error at issue here, as in Neder, is simply an error in the trial process, not a structural error defying harmless-error review by "affecting the framework within which the trial proceeds." Neder, 527 U.S. at 19, 119 S.Ct. 1827. Our inquiry is not "whether, in a trial that occurred without the error, a guilty verdict would surely have been rendered, but whether the guilty verdict actually rendered in this trial was surely unattributable to the error." Sullivan v. Louisiana, 508 U.S. 275, 279, 113 S.Ct. 2078, 124 L.Ed.2d 182 (1993). The government bears the burden of showing that the error had no effect on a defendant's substantial rights. Lilly, 142 Idaho at 72, 122 P.3d at 1172. If, after examining the record, the reviewing court "cannot conclude beyond a reasonable doubt that the jury verdict would have been the same absent the error . . . it should not find the error harmless." Neder, 527 U.S. at 19, 119 S.Ct. 1827. Thus, the error is reversible where a jury is not instructed as to an element of an offense and the record contains evidence that could rationally lead to a finding in favor of the defendant with respect to the omitted element. Id.; Lovelace, 140 Idaho at 79, 90 P.3d at 304.
In Neder, the defendant pled not guilty but did not bring forth facts contesting an omitted element. The Court explained that "answering the question whether the jury verdict would have been the same absent the error does not fundamentally undermine the purposes of the jury trial guarantee" where the state's evidence with respect to the omitted element is overwhelming. Neder, 527 U.S. at 19, 119 S.Ct. 1827; see also Johnson v. United States, 520 U.S. 461, 470, 117 S.Ct. 1544, 137 L.Ed.2d 718 (1997) (concluding that error of omission did not warrant reversal where evidence was uncontroverted and overwhelming). Thompson contends in the instant case, however, that he contested the omitted element by pleading not guilty, and that this alone was sufficient for the judgment of conviction to be in violation of his right to have a jury determine whether he knew the substance in his possession was in fact a controlled substance. Thompson cites State v. Cutler, 94 Idaho 295, 296, 486 P.2d 1008, 1009 (1971), for the proposition that a plea of not guilty puts in issue every material allegation in the criminal charge. As Thompson would have it, unless an element is conceded by a defendant pleading not guilty, there can be no harmless error.
We disagree. Although in Neder, the omitted element was not contested, the Neder analysis does not limit harmlessness to that circumstance. According to Neder, even if the element was in some manner genuinely contested, we must determine whether the "record contains evidence that could rationally lead to a finding for the defendant, with respect to that omitted element." Neder, 527 U.S. at 19, 119 S.Ct. 1827. Where there is no basis in the record that could rationally lead to a finding for the defendant, the jury instruction error is harmless. United States v. Pettigrew, 346 F.3d 1139, 1146-47 (D.C.Cir.) (no basis for concluding quantity of crack cocaine was not above the fifty-gram threshold).
The degree to which the defendant must "contest" the omitted element logically depends on the strength of the state's evidence and the amount of evidence necessary to rationally lead to a finding for the defense with respect to the omitted element. As we indicated in Lilly, 142 Idaho at 73, 122 P.3d at 1173, it is not necessarily required that a defendant must take the stand and expressly deny the omitted element before the element can be deemed contested. On the other hand, depending upon the strength of the state's evidence, merely pleading not guilty and thus putting the element at issue may *761 not be a sufficient "contest" of the element to prevent a determination of harmless error when the element is omitted from the jury instructions. See and compare Peteja, 139 Idaho at 614, 83 P.3d at 788 (finding harmless error where jury rejected defendant's defense of not swallowing bag of white powder or anything else and uncontroverted evidence on omitted elements established the bag contained methamphetamine) with State v. Nath, 137 Idaho 712, 717, 52 P.3d 857, 862 (2002) (prejudice found where the jury instruction omitted material element and the record contained evidence that could rationally lead to a contrary finding with respect to the omitted element) and Lilly, 142 Idaho at 73, 122 P.3d at 1173 (noting element was contested by defendant's testimony). See also State v. Brill, 21 Idaho 269, 274-76, 121 P. 79, 80-81 (1912) (where defense was based upon alibi, not ownership, defendant suffered no resulting prejudice from erroneous instruction that ownership of stolen money need not be proven).
In the instant case, by finding Thompson guilty, the jury rejected his defense that the substance was not found on his person. Thompson's defense was that the police had lied about finding the contraband in his possession. He claimed that the police testimony was false relative to the two baggies of methamphetamine allegedly discovered in his sweat pants pockets because on the night of his arrest he was wearing sweat pants without pockets. However, Thompson did not present any evidence whereby the jury could reject his "pocketless sweat pants" defense, find (as it did) that he had a controlled substance in his pockets and nevertheless, acquit on a reasonable doubt as to whether Thompson realized that the substance was a controlled substance. See Blake, 133 Idaho at 242, 985 P.2d at 122 (ignorance or mistake of fact, e.g., cocaine thought by defendant to be sugar, if believed by the jury, would disprove any criminal intent); State v. Lamphere, 130 Idaho 630, 945 P.2d 1 (1997) (testimony tending to prove that a defendant did not know that the substance possessed was methamphetamine was relevant exculpatory evidence).
Similar to the factual situation in Peteja, the evidence in this case gives no rational basis for a jury to doubt that Thompson knew the nature of the substance in his pocket. The state presented evidence that Thompson had a hypodermic needle in his hand when he came to answer the deputy's knock, and that he retreated to the back of the house when the officer identified himself as a sheriff's deputy. A hypodermic needle later was found floating in the toilet in the bathroom at the back of the house. The state further presented evidence that in the back area of the house there were many items indicating drug use  drug paraphernalia, cash, scales, packaging materials, and a baggie of methamphetamine  all in plain sight. The methamphetamine in his pocket was contained in a "bindle" of the sort commonly used to package controlled substances. No evidence suggested that Thompson could have known that he carried the substance without knowing what it was.
The record does not contain evidence that could rationally lead to a contrary finding with respect to the omitted element. There is no basis to conclude that Thompson did not know the substance found in his pocket was methamphetamine or another type of controlled substance. Even though the jury instructions omitted the element of knowing the substance was in fact a controlled substance, our review of the record shows beyond a reasonable doubt that the jury's verdict was not attributable to such error. Accordingly, the error was harmless.

III.

CONCLUSION
Although the elements jury instruction at issue was missing an essential element, that error was harmless. There was overwhelming evidence that Thompson knew the substance possessed was in fact controlled. Because the record did not contain evidence that could rationally lead to a contrary finding with respect to the omitted element, we affirm the judgment of conviction for possession of methamphetamine.
*762 Judge LANSING and Judge Pro Tem WALTERS concur.
NOTES
[1]  The court instructed the jury as to the following elements of the crime:

In order for the defendant to be guilty of POSSESSION OF A CONTROLLED SUBSTANCE, the state must prove each of the following:
1. On or about October 13th, 2003;
2. in the state of Idaho;
3. the defendant ANTHONY KIRK THOMPSON;
4. possessed;
5. a controlled substance.
The pattern jury instruction for this offense, ICJI 403, correctly sets forth the elements as follows:
In order for the defendant to be guilty of Possession of a Controlled Substance, the state must prove each of the following:
1. On or about [date]
2. in the state of Idaho
3. the defendant [name] possessed any amount of [name of substance], and
4. the defendant either knew it was [name of substance] or believed it was a controlled substance.
