
726 N.E.2d 120 (2000)
312 Ill. App.3d 4
244 Ill.Dec. 524
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Charles DURDIN, Defendant-Appellant.
No. 1-98-3543.
Appellate Court of Illinois, First District, First Division.
February 22, 2000.
*121 Rita A. Fry, Cook County Public Defender, Chicago (Protase M. Tinka, of counsel), for Appellant.
Richard A. Devine, Cook County State's Attorney, Chicago, (Renee Goldfarb and William D. Carroll, of counsel), for Appellee.
Presiding Justice FROSSARD delivered the opinion of the court:
Defendant Charles Durdin was convicted of one count of delivery of cocaine within 1,000 feet of a school, a Class 1 felony, and convicted of one count of delivery of heroin, a Class 2 felony. He was sentenced to seven years in prison. On appeal, defendant contends that the trial court erred in convicting him of delivery of cocaine within 1,000 feet of a school because none of the evidence introduced at trial established that the single transaction at issue involved cocaine. Defendant also contends that the sentence imposed by the *122 trial court was unauthorized because it was based upon the erroneous conviction.

I. FACTS
On April 6, 1998, the defendant was indicted for delivery of a controlled substance. Count I of the indictment alleged that defendant delivered less than one gram of cocaine on a public way within 1,000 feet of a public school. Count II alleged that defendant delivered less than 10 grams of heroin.
The testimony at trial established that on March 5, 1998, Chicago police officer Lawrence Fields was working as an undercover narcotics buyer on South Keeler Avenue in Chicago. He approached defendant, who asked the officer what he needed. Officer Fields told defendant that he wanted "two blows," a street term for two packets of white heroin. Defendant approached Paul Brown, and after defendant spoke with Brown, defendant received two tinfoil packets from Brown. Fields then gave defendant $20 in prerecorded funds for the two packets and defendant gave the money to Brown. The parties stipulated that the tinfoil packets contained heroin.
After the transaction was completed, Fields radioed the enforcement officers, who arrested defendant and Brown. The arresting officers found the $20 in prerecorded funds in Brown's jacket pocket but did not find any more drugs during their search of the two men. Defendant testified that he was a drug user and not a deliverer. Defendant acknowledged that he bought heroin for Fields but claimed that Fields entrapped him to perform the criminal act. The trial court rejected defendant's entrapment defense and convicted defendant on both counts. The trial court sentenced defendant to one seven-year sentence of imprisonment. The record indicates that the trial court did not mention the fact that the count for delivery within 1,000 feet of a school alleged delivery of cocaine rather than delivery of heroin. In finding defendant guilty, the trial court noted:
"I think it's quite clear that Mr. Durdin committed the transaction of delivering the heroin to Officer Fields in conjunction with the defendant Brown. The defendant's version simply doesn't hold up."

II. ANALYSIS
Defendant first contends that the conviction on count I for delivery of cocaine within 1,000 feet of a school must be reversed because none of the evidence at trial established delivery of cocaine. According to defendant, the discrepancy between the allegations in count I of the indictment and the proof at trial requires reversal of the conviction on count I and resentencing on count II. Count I is a Class 1 felony, and count II is a Class 2 felony. The defendant does not contest his conviction for count II, delivery of heroin.
The State concedes the variance between the indictment and the proof presented at trial and agrees that reversal of count I of the indictment is proper. Although this court is not bound by the State's confession of error (People v. Kelly, 66 Ill.App.2d 204, 209, 214 N.E.2d 290 (1965)), we agree with the parties that the variance between the indictment and the proof of trial requires reversal of count I. "In a criminal trial, it is the burden of the prosecution to prove beyond a reasonable doubt all material facts of the offense as charged by the indictment. [Citations.] By utterly failing to introduce proof to conform to the charge in the indictment, the State failed in its burden of proof at trial." People v. Daniels, 75 Ill.App.3d 35, 40, 30 Ill.Dec. 631, 393 N.E.2d 667 (1979).
The standard of review for challenging the sufficiency of the evidence is whether, after viewing all the evidence in the light most favorable to the prosecution, any rational trier of fact could have found *123 the essential elements of the crime beyond a reasonable doubt. People v. Collins, 106 Ill.2d 237, 261, 87 Ill.Dec. 910, 478 N.E.2d 267 (1985). The substantive elements of a charge of delivery of controlled substance require the State to prove at trial that defendant knowingly delivered a controlled substance. 720 ILCS 570/401(d) (West 1998); People v. Brooks, 271 Ill.App.3d 570, 575, 207 Ill.Dec. 926, 648 N.E.2d 626 (1995) ("the State was required to prove that defendant knew he was delivering cocaine").
In addition, a defendant that knowingly delivers a controlled substance within 1,000 feet of a school may be sentenced to an increased term of imprisonment. See, e.g., 720 ILCS 570/407(b)(2) (West 1998) (enhancing felony for delivery of controlled substance from Class 2 to Class 1 felony for delivery that occurs in a school, public housing building, place of religious worship, or senior citizen building, or on a public way and within 1,000 feet of a school, public housing building, place of religious worship, or senior citizen building). To prove this enhancing factor, the State need only prove the offense occurred within 1,000 feet of a school. The State is not required to prove that defendant was aware that the offense occurred within 1,000 feet of a school. People v. Pacheco, 281 Ill.App.3d 179, 186-87, 216 Ill.Dec. 920, 666 N.E.2d 370 (1996). Even if defendant raises the affirmative defense of entrapment when charged with delivery of a controlled substance, the State must still prove beyond a reasonable doubt each element of the crime. People v. Fernandez, 240 Ill.App.3d 518, 520, 181 Ill.Dec. 414, 608 N.E.2d 487 (1992).
In this case, the State failed to present any evidence that defendant knowingly delivered cocaine within 1,000 feet of a school. The State's witnesses testified that defendant delivered "blow" and that "blow" was a street term for heroin. The parties stipulated that the controlled substance at issue was heroin. When finding defendant guilty of the count I, delivery of cocaine within 1,000 feet of a school, neither the parties nor the trial judge realized the discrepancy between the indictment and the trial testimony. However, the proof at trial failed to prove count I of the indictment. Moreover, the State also stipulated that the controlled substance at issue was heroin and never moved to amend count I of the indictment. Here the State was required to prove that defendant knew he was delivering cocaine. People v. Brooks, 271 Ill.App.3d 570, 575, 207 Ill. Dec. 926, 648 N.E.2d 626 (1995). The conviction for delivery of cocaine within 1,000 feet of a school under count I cannot stand because the State did not present evidence beyond a reasonable doubt to support each element of the charge in the indictment. The State therefore failed to prove defendant guilty beyond a reasonable doubt of delivery of cocaine within 1,000 feet of a school.
We are aware that a variance between a crime charged and the crime proved is not fatal to the conviction unless the variance is material and it misleads the accused in making his defense or exposes him to double jeopardy. People v. Jones, 245 Ill.App.3d 674, 677, 185 Ill.Dec. 814, 615 N.E.2d 373 (1993). Here, the variance, however, was material because it was the controlled substance allegedly delivered, an element of the charge in count I of the indictment. The record is devoid of any evidence of cocaine, and we cannot speculate how defendant may have changed his defense if the proof at trial had been cocaine. Count I, delivery of cocaine within 1,000 feet of a school, is a Class 1 felony, while count II is a Class 2 felony. In general, conviction of a greater class felony has more potential prejudicial impact in the context of sentencing. Based on the totality of the circumstances, we cannot say on this record that no actual prejudice or no realistic possibility of prejudicial uncertainty existed and therefore the variance here is fatal to the conviction.
*124 We further note that this court has affirmed an armed robbery conviction even though the indictment and the proof at trial varied as to the name of the victim of the crime. People v. Santiago, 279 Ill. App.3d 749, 216 Ill.Dec. 320, 665 N.E.2d 380 (1996). In Santiago, the information charged defendant with committing an armed robbery against Alfredo Jiminez while at trial Teodulo Rodriquez testified that defendant robbed him. The State never moved to amend the indictment. Defendant argued on appeal that because the victim alleged in the indictment differed from the victim at trial, his conviction should be reversed. The appellate court disagreed. It noted that defendant did not deny that Rodriquez was robbed but claimed that Rodriquez mistakenly identified him. The court therefore found that the variance in the information was not fatal to the conviction because defendant did not sustain any prejudice and double jeopardy prevented defendant from being subjected to a second trial for the armed robbery against Rodriquez. The trial testimony and record undisputably established that the right defendant was tried for the right armed robbery. Santiago, 279 Ill.App.3d at 753-54, 216 Ill.Dec. 320, 665 N.E.2d 380.
The critical difference between the case at bar and Santiago is that in Santiago the State proved at trial, by actual testimony, that defendant committed the armed robbery of Rodriquez even though the information alleged defendant robbed Jiminez. Ultimately, defendant was convicted of and sentenced for the armed robbery against Rodriquez. Unlike Santiago, here the State never proved at trial, by actual testimony or other evidence, that defendant delivered cocaine within 1,000 feet of a school. Therefore, unlike Santiago, the record does not support the finding that defendant committed the offense of delivery of cocaine within 1,000 feet of a school. Defendant was convicted and sentenced for delivery of cocaine when there was no evidence that cocaine was delivered by the defendant. Defendant was convicted of the wrong crime. Therefore, under count I defendant's conviction for delivery of cocaine within 1,000 feet of a school is reversed.
Defendant next argues that he should be resentenced because his current sentence was based upon the erroneous conviction for delivery of cocaine within 1,000 feet of a school under count I. At defendant's sentencing hearing, the State argued that defendant was eligible for a Class X sentence because of his criminal background. The State additionally noted that under count I defendant's conviction of delivery of cocaine within 1,000 feet of a school was a Class 1 felony, while defendant's conviction under count II for delivery of heroin was a Class 2 felony. Defense counsel agreed that defendant should be sentenced as a Class X offender based on his criminal background and requested the minimum of six years. The court sentenced defendant to a single seven-year term of imprisonment.
Defendant's conviction under count I was a Class 1 felony because of the enhanced factor of the offense occurring within 1,000 feet of a school. 720 ILCS 570/407(b)(2) (West 1998). Defendant's conviction under count II was only a Class 2 felony because it was for delivery of heroin, but it contained no enhancing factor. However, under section 5-5-3(c)(8) of the Unified Code of Corrections (730 ILCS 5/5-5-3(c)(8) (West 1998)), defendant was required to be sentenced as a Class X offender. This section provides that "[w]hen a defendant, over the age of 21 years, is convicted of a Class 1 or Class 2 felony, after having twice been convicted of any Class 2 or greater Class felonies in Illinois, and such charges are separately brought and tried and arise out of different series of acts, such defendant shall be sentenced as a Class X offender." 730 ILCS 5/5-5-3(c)(8) (West 1998). Here, defendant had prior felony convictions for burglary in 1984, a Class 2 felony, armed robbery in 1988, a Class X felony, and *125 possession of a controlled substance with intent to deliver in 1995, a Class 2 felony. Therefore, under either count I or count II, defendant's background mandated that he be sentenced as a Class X felon to a term of imprisonment between 6 and 30 years. 730 ILCS 5/5-8-1(a)(3) (West 1998).
In aggravation the prosecution noted the defendant's extensive criminal background. The State also referenced the fact that the defendant admitted that he was born into the K Town Cobra street gang and that his parents were both gang members. In mitigation the defense attorney recognized the defendant's history but pointed out that he had never received drug treatment and recommended the minimum of six years. He additionally requested that defendant be sentenced as an addict and receive treatment while incarcerated.
After hearing evidence in aggravation and mitigation, the trial court sentenced defendant to a single seven-year term imprisonment for his convictions under both counts. Before imposing sentence, the trial court referred to defendant's extensive criminal background. The court stated:
"Mr. Durdin, you have a substantial problem here, and one of your problems simply is not dealing with your problem when you're at liberty to do so, sir. You wait for the system to impose that on you. Well, the system also imposes a severe penalty when you don't take steps on your own. Mr. Durdin, the fear I have sir, is that based on your prior convictions, you also pose a threat to the safety of the citizens out there based on a prior armed robbery and burglary. * * * I don't know that you are going to be able to deal with your problem until you are really, your last rope there, [sic] and you desperately needing for drugs and money to buy drugs, and that's when you could do some real harm. But it has been1988 was, [sic] that's about ten years. So Mr. Durdin, I am going to sentence you to seven years in the Illinois Department of Corrections."
Here, defendant was convicted of the single act of delivering a controlled substance. The trial court properly sentenced defendant to one sentence for both convictions. "Where two convictions are based upon a single act, the defendant should be sentenced only for the most serious offense." People v. Cunningham, 253 Ill.App.3d 642, 652, 192 Ill.Dec. 453, 625 N.E.2d 413 (1993). Although the record reflects that the court discussed defendant's background before sentencing him, we cannot ignore the fact that the trial court sentenced defendant for the conviction under count I, the delivery of cocaine within 1,000 feet of a school, which was the most serious offense. This conviction, based on the very real public policy concerns of deterring narcotic crimes near schools, was clearly more serious than the conviction for delivery of heroin without the enhancing factor.
In recommending a 16-year sentence, the prosecution argued as follows: "Based on his background, your honor, the defendant is eligible for a Class X sentence. He was convicted here of delivery of a controlled substance within a thousand feet of a school. It's a Class 1 [offense], but because of his background, he is eligible for Class X sentencing. We are recommending to the court that the defendant be sentenced to 16 years [in the] Illinois Department of Corrections." After a thorough review of this record, we cannot determine what weight in sentencing was given by the trial court to the fact that defendant had been convicted for delivery of cocaine within 1,000 feet of a school, which based on the evidence was an improper conviction.
We recognize that the trial court's sentence in this case was proper in light of defendant's Class X status, which was triggered by conviction under, not only count I, but also under count II, which was a Class 2 felony. However, when the reviewing court cannot determine the *126 amount of weight given to an improper factor in sentencing, the defendant must be resentenced. People v. Bourke, 96 Ill.2d 327, 332, 70 Ill.Dec. 734, 449 N.E.2d 1338 (1983). When resentenced, defendant will again be subject to the Class X statutory range. 730 ILCS 5/5-8-1(a)(3) (West 1998).
This is not a case where we can vacate a less serious offense and allow a separate sentence to stand for a more serious offense since we are reversing the conviction for the more serious offense. See People v. Payne, 98 Ill.2d 45, 57, 74 Ill.Dec. 542, 456 N.E.2d 44 (1983) (no requirement of new sentencing hearing when court vacated burglary conviction but upheld concurrent sentence for more serious offenses of armed robbery and armed violence predicated upon burglary). Therefore, defendant is entitled to a new sentencing hearing for his conviction of delivery of heroin under count II of the indictment.
Further, when defendant is resentenced, the "court shall not impose a new sentence for the same offense * * * which is more severe than the prior sentence less the portion of the prior sentence previously satisfied unless the more severe sentence is based upon conduct on the part of the defendant occurring after the original sentencing." 730 ILCS 5/5-5-4 (West 1998). This section of the statute does not allow an increase in sentence unless it is based upon defendant's conduct after the original sentence. However, the trial court is not barred from imposing the original sentence if upon proper consideration of the facts and the applicable sentencing factors such sentence is warranted.
We note that a reviewing court will not disturb a sentence that falls within the statutory limits. People v. Streit, 142 Ill.2d 13, 153 Ill.Dec. 245, 566 N.E.2d 1351 (1991). In determining an appropriate sentence, the defendant's history, character and rehabilitative potential, the seriousness of the offense, the need to protect society and the need for deterrence and punishment must be equally weighed. People v. Taylor, 236 Ill.App.3d 223, 232, 177 Ill.Dec. 541, 603 N.E.2d 611 (1992).

III. CONCLUSION
For the foregoing reasons, we reverse defendant's conviction for delivery of a controlled substance (cocaine) within 1,000 feet of a school. We affirm defendant's conviction for delivery of a controlled substance (heroin) and remand for resentencing on this conviction.
Reversed in part and affirmed in part; cause remanded for resentencing.
RAKOWSKI and GALLAGHER, JJ., concur.
