
136 Ill. App.3d 863 (1985)
483 N.E.2d 1328
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
STANLEY ROBERTS, Defendant-Appellant.
No. 3-85-0073.
Illinois Appellate Court  Third District.
Opinion filed September 26, 1985.
*864 Robert Agostinelli and Peter A. Carusona, both of State Appellate Defender's Office, of Ottawa, for appellant.
James T. Teros, State's Attorney, of Rock Island (John X. Breslin and Raymond L. Beck, both of State's Attorneys Appellate Service Commission, of counsel), for the People.
Judgment affirmed.
JUSTICE SCOTT delivered the opinion of the court:
The defendant, Stanley Roberts, was charged with the offenses of aggravated battery, armed violence, and unlawful use of weapons. (Ill. Rev. Stat. 1983, ch. 38, pars. 12-4(b)(1), 33A-2, 24-1(a)(8), respectively.) A jury returned verdicts of not guilty on the first two charges but found the defendant guilty of unlawful use of weapons. The court entered a felony conviction on the jury verdict and sentenced the defendant to a four-year term of imprisonment. The defendant appeals, arguing that the trial court erred in instructing the jury. Alternatively, the defendant argues that he was not proved guilty beyond a reasonable doubt of a felony violation, and that the sentencing court made an inappropriate finding in aggravation. We affirm.
The instant charges arose out of an incident which occurred in the Sylvis Lounge in June of 1984. On the night of the incident, the defendant was playing pool in the lounge when Wayne Schumacher entered the lounge and approached the defendant. In the struggle which ensued between Schumacher and the defendant, the defendant used a handgun as a club to strike Schumacher. By the end of the struggle, Schumacher and a woman in the bar both had been shot with the defendant's gun. The defendant contended, and the jury apparently believed, that the shootings were accidents.
 1 The defendant's first argument on appeal is that the court improperly refused his instruction on necessity. According to the defendant, he presented some evidence to support a necessity defense to the offense of unlawful use of weapons.
One who is not exempt from the prohibition, violates the unlawful use of weapons statute when he "[c]arries or possesses any firearm, * * * in any place which is licensed to sell intoxicating beverages, * * *." *865 (Ill. Rev. Stat., 1984 Supp., ch. 38, par. 24-1(a)(8).) The defendant does not fall within any of the statutory exemptions.
In Illinois, the affirmative defense of necessity statutorily provides that "[c]onduct which would otherwise be an offense is justifiable by reason of necessity if the accused was without blame in occasioning or developing the situation and reasonably believed such conduct was necessary to avoid a public or private injury greater than the injury which might reasonably result from his own conduct." (Emphasis added.) (Ill. Rev. Stat. 1983, ch. 38, par. 7-13.) A criminal defendant is entitled to have a jury instruction on any legally recognized affirmative defense theory on which he has presented "some evidence." (Ill. Rev. Stat. 1983, ch. 38, par. 3-2; People v. Unger (1977), 66 Ill.2d 333, 362 N.E.2d 319.) On review, we must determine whether there was "some evidence" to support the defense. People v. Adcock (1975), 29 Ill. App.3d 917, 331 N.E.2d 573.
There is no dispute that on the night in question the defendant had a firearm in his possession inside a place licensed to sell intoxicating beverages. The defendant contends, however, that the jury should have been instructed on necessity as he introduced evidence that there was a contract on his life; that he was without blame in developing the situation of a contract on his life; and that he reasonably believed it was necessary to carry a gun in order to avoid his own murder.
In our view, the defendant's proof does not satisfy even the low standard of "some evidence" of necessity. We find first that, given the definition of the charged offense in question, and despite the defendant's and trial court's differing analysis, "the situation" relevant here is not the existence of a contract on the defendant's life. Rather, the relevant situation is the defendant's possession of a handgun inside the Sylvis Tavern. We find no evidence to support the required finding that the defendant could have reasonably believed it necessary to avoid a greater danger that he carry a gun into the tavern. Furthermore, we find that the defendant clearly was to blame in occasioning the situation of his presence in the tavern while armed. Because the defendant could have chosen not to enter the tavern, his criminal behavior may not be excused for necessity. (Compare People v. Unger (1977), 66 Ill.2d 333, 362 N.E.2d 319; People v. Whitson (1984), 127 Ill. App.3d 999, 470 N.E.2d 1054.) The court properly refused to instruct the jury on necessity.
The following additional facts are relevant to the defendant's first alternative argument. Prior to jury selection, the court discussed with counsel for the defendant and for the State how to treat the evidence *866 of the defendant's prior felony conviction. The defendant objected to the jury's either being read the prior-felony element in the unlawful use of weapons charge or receiving evidence of the prior conviction. He expressed a desire to stipulate to the prior conviction.
The court acknowledged the decision of People v. Ostrand (1966), 35 Ill.2d 520, 221 N.E.2d 499, which held that under the circumstances there, the defendant's prior felony conviction was properly and necessarily pleaded and proved to support the felony conviction of unlawful use of weapons. The court then stated it would accept the defendant's stipulation on the element of the prior felony as a "partial plea" of guilty. The court fully admonished the defendant of the consequences of the "partial plea." As a factual basis for the "plea," the court received evidence of the defendant's 1978 conviction of burglary and resulting 1979 commitment to the Department of Corrections.
The jury received no evidence of the defendant's prior felony. In returning a guilty verdict as to the offense of unlawful use of weapons, the jury made no finding on the defendant's prior conviction. Per its admonishments prior to accepting the defendant's "plea," upon receiving the guilty verdict, the court entered a felony conviction for the offense.
 2 On appeal, the defendant argues that his felony conviction for unlawful use of weapons must be reduced to a misdemeanor. The unlawful use of weapons statute before us provides that a person convicted of that offense is guilty of a Class A misdemeanor unless that person has a qualifying prior felony conviction. In the latter case, the accused is guilty of a Class 3 felony. (Ill. Rev. Stat. 1983, ch. 38, par. 24-1(b).) The defendant argues that the State did not prove beyond a reasonable doubt the prior-felony element necessary for a felony conviction.
In support of his argument, the defendant cites a number of cases, including People v. Ostrand (1966), 35 Ill.2d 520, 221 N.E.2d 499, People v. Owens (1967), 37 Ill.2d 131, 225 N.E.2d 15, People v. Edwards (1976), 63 Ill.2d 134, 345 N.E.2d 496, People ex rel. Carey v. Pincham (1979), 76 Ill.2d 478, 394 N.E.2d 1043, and People v. Palmer (1984), 104 Ill.2d 340, 472 N.E.2d 795. In that line of cases, beginning with Ostrand and reaffirmed most recently in Palmer, the supreme court has uniformly held that it is proper to introduce, during the evidentiary stage of trial, evidence of prior convictions that serve to increase the degree of the offense of unlawful use of weapons. Also, based on that line of cases, the appellate court has strictly held that the existence of a degree-elevating prior conviction is an element of the unlawful-use-of-weapons offense which must be pleaded and *867 proved to the trier of fact prior to a finding of guilt. See People v. Cook (1984), 129 Ill. App.3d 531, 472 N.E.2d 856; People v. Breitweiser (1976), 44 Ill. App.3d 284, 357 N.E.2d 890.
Although neither the defendant nor the State acknowledges the fact, we observe that the rulings of the Ostrand line of cases have been limited by the decision in People v. Hayes (1981), 87 Ill.2d 95, 429 N.E.2d 490. Hayes, which was not addressed in Cook and which reversed an appellate decision relied on in Breitweiser, has procedural facts similar to those in the instant case and different from those presented in Palmer.
In Hayes, per the appropriate sentencing statute, the defendant's offense of retail theft was enhanced in the trial court to a felony because of the defendant's prior conviction. The defendant argued under Ostrand and its progeny that she could not be convicted of a felony as her degree-enhancing prior conviction was not alleged in the information. The prior conviction was stipulated in the bench trial. The supreme court found no sound reason to risk prejudice to the defendant by requiring allegation and proof of the prior conviction. Instead, the court held that the defendant's felony conviction was proper as the defendant had notice that the State sought a felony conviction, the prior conviction was stipulated, and the defendant showed no prejudice as a result of the procedure followed. We make similar findings here.
This is not a case, as in Palmer, where the court is called to decide prior to trial whether the State may properly present the jury with evidence of a defendant's prior conviction. Here, quite differently, the defendant seeks to invalidate a trial procedure whereby both he and the State agreed not to present the jury with evidence of the defendant's prior conviction but to rely on the defendant's informed stipulation to enhance the possible conviction to a felony.
Here, the defendant's charge alleged his degree-enhancing prior conviction. The trial court received proof beyond a reasonable doubt of that conviction. The defendant was fully notified of the State's objective to secure a felony conviction and of the possible consequences of his stipulation to his prior conviction. Further, we are aware of only benefit and no prejudice to the defendant by the trial court's procedure here. We conclude that under Hayes, and in accord with our prior decision in People v. Stapleton (1983), 115 Ill. App.3d 1067, 451 N.E.2d 584, that the defendant was properly sentenced for a felony violation of unlawful use of weapons.
 3 The defendant's second alternative argument on appeal is that the sentencing court erroneously found in aggravation that the *868 defendant fired a gun and caused Kimberly O'Neil, an innocent bystander, to be injured. According to the defendant, the evidence and his acquittals for aggravated battery and armed violence do not support the court's determination that the defendant "fired" the gun. Rather, the only supportable conclusion, according to the defendant, is that he chose not to fire the gun but it discharged when he recklessly used it as a bludgeon.
The State, in response, correctly argues that the defendant's argument is without merit. Under the Code, a sentencing court may consider in aggravation that the defendant's conduct caused or threatened serious harm. (Ill. Rev. Stat. 1983, ch. 38, par. 1005-5-3.2(a)(1).) Here, the court properly considered that a gun in the defendant's hand discharged and caused serious harm to O'Neil. We agree with the State that there was no failure of evidence that the defendant's carrying a gun into the tavern was causally connected to the serious harm caused to O'Neil. It is inconsequential for purposes of the instant finding in aggravation that the defendant did not intentionally fire a shot which injured O'Neil.
Based on the foregoing, the judgment of the circuit court of Rock Island County is hereby affirmed.
Affirmed.
HEIPLE, P.J., and WOMBACHER, J., concur.
