
603 P.2d 1050 (1979)
The STATE of Montana, Plaintiff and Respondent,
v.
Mark Thomas NELSON, Defendant and Appellant.
No. 14848.
Supreme Court of Montana.
Submitted November 8, 1979.
Decided December 14, 1979.
Fisher & Erickson, Whitefish, Leif B. Erickson argued, Whitefish, H.L. Garnaas, Missoula, Hash, Jellison, O'Brien & Bartlett, Kalispell, for defendant and appellant.
Mike Greely, Atty. Gen., Helena, Mary B. Troland, Asst. Atty. Gen. argued, Helena, Ted O. Lympus, County Atty., Kalispell, for plaintiff and respondent.
*1051 DALY, Justice.
Defendant was charged by information filed in the District Court of the Eleventh Judicial District of the State of Montana, in and for the County of Flathead, with the offense of aggravated assault. During his arraignment, defendant pleaded guilty to the charge. The plea was accepted at a later hearing held to determine the facts which were the basis of the guilty plea. Subsequently, the District Court ruled that the mandatory minimum two-year sentence provision of section 45-5-202(2), MCA, applied, and the criteria for the exceptions to the mandatory two-year sentence found in section 46-18-222, MCA, had not been met. A sentence of twenty years in the state prison, with all but three years suspended, was imposed. Defendant then filed an appeal from the finding that the mandatory minimum two-year sentence applied in his case. Thereafter, defendant filed a motion with the District Court requesting leave to withdraw his plea of guilty to the offense of aggravated assault and enter a plea of not guilty. This motion was denied and sentence imposed. Defendant appeals from the judgment.
On September 17, 1978, the date of the assault, defendant began drinking early in the day. He was depressed due to a fight with his girlfriend and during the day, he consumed approximately one pint of 100-proof vodka and some prescription sleeping pills while only eating a hamburger. As a result of this combination of alcohol, drugs and lack of food, defendant became intoxicated.
Sometime during the morning defendant was informed that a 9mm automatic pistol he had loaned to a friend had been returned to the friend's house. He went to his friend's house to recover the pistol and its accessories, which included a 14-shot clip and a shoulder holster. For ease in carrying the pistol, he put the shoulder holster on and placed the pistol in it. Later that morning he loaded the clip and went out to take target practice. During this practice he fired three or four shots and then placed the weapon in the holster. Apparently, the pistol was still in a cocked position when it was returned to the holster.
After the target practice defendant drove to his trailer home located on LaSalle Road across from a Circle K store to take a nap. He slept until late afternoon and upon waking, decided to call his girlfriend. Having no phone in his trailer, he walked across the street to the Circle K store to make the call. He was still carrying the pistol in the shoulder holster.
By the time defendant left the Circle K store, it had become dark. As he was recrossing LaSalle Road to return to his trailer, a pickup truck approached traveling south. At this point there are two differing versions of the facts that occurred.
The first version is that of the driver of the pickup truck, Harold Keller. Keller testified that he was driving his pickup south on LaSalle Road near the Circle K when a man, later identified as defendant, wandered across the street in front of his truck. Keller stopped his truck to allow the man to cross in front of him. Keller maintains defendant was swearing and waving his arms and pounded on the hood of the vehicle. Keller proceeded to drive away when defendant started yelling and swearing. Keller stopped his truck and looked through the back window at defendant who was just behind the truck. Keller testified that defendant reached into his pocket, pulled out a gun and fired. As the gun fired, defendant fell over backwards and the gun slid off the road. Keller then sped off and called the police. Keller testified that he thought defendant was either drunk or out of his mind.
At the time of the shooting, defendant was about ten feet away from where Keller was sitting in his truck. However, the slug did not strike the pickup nor did it injure anyone, nor was it found.
Defendant's version of the facts only differs on a few key points. He testified that Keller yelled and swore at him as he went by and that he first thought there were two people in the truck. When the pickup stopped he thought he was in danger. He testified that he pulled out the pistol to *1052 show the people in the truck that he had something with which to protect himself. In the act of pulling it out, he dropped the gun and being in a cocked position, it fired on hitting the ground. He testified he had not intended to shoot the gun at all when pulling it out and the discharge was accidental.
On November 27, 1978, defendant was charged in District Court with the offense of aggravated assault in violation of section 94-5-202(1)(c), R.C.M. 1947 (now section 45-5-202(1)(c), MCA), by firing a pistol at Harold Keller. The defendant was arraigned on January 22, 1979. At that time he stated he wished to plead guilty. The trial judge, on finding that a factual basis was necessary prior to accepting defendant's plea, questioned him as to the events culminating in the aggravated assault charge. Defendant replied that his memory of events was unclear because of his level of intoxication at the time of the crime. He did state, however, that he had been carrying a gun on the night in question and that the weapon had been discharged.
The trial judge at that point declined final acceptance of defendant's guilty plea until a more adequate factual basis could be established. On February 16, 1979, the arraignment was continued. At that time Harold Keller testified as to his version of the incident. Defendant declined to cross-examine Keller and did not present evidence.
The trial judge accepted defendant's guilty plea, finding that there was sufficient factual basis for such action. The judge also made reference to the fact that the guilty plea was entered in accordance with a plea bargain arrangement whereby the State agreed to drop certain charges in justice court in return for the entry of the plea to the aggravated assault charge.
On May 29, 1979, a hearing was held for evidence in aggravation and mitigation of sentence. During this hearing defendant, for the first time, revealed his version of the incident. In addition to the testimony of defendant, of defendant's character witnesses, and of the victim, the trial judge also had before him, at the sentencing hearing, a presentence report and an evaluation report from the state prison where defendant had been given a 45-day evaluation. Based on this evidence, the trial judge sentenced defendant to twenty years in the state prison, all but three suspended. In doing so, the judge specifically found that defendant was subject to the mandatory minimum sentence of the aggravated assault statute.
On July 11, 1979, a hearing was held on defendant's motion to withdraw his plea of guilty and enter a plea of not guilty. The motion was based on the allegation that the plea was invalid because defendant had not admitted the facts of the crime as asserted by the victim. The trial judge denied the motion ruling there was an adequate factual basis for acceptance of the plea based on defendant's and the victim's testimony at the arraignment. Defendant appeals both his sentence and the denial of his motion to withdraw his plea of guilty.
Two issues are presented to this Court for review:
1. Did the District Court err in accepting the guilty plea entered by defendant?
2. Did the District Court err in determining that the mandatory two-year sentence provision for aggravated assault under section 45-5-202(2), MCA, applied under the facts of this case?
The first issue to be resolved is whether the District Court erred in denying defendant's motion to withdraw his guilty plea.
General principles governing the withdrawal of a guilty plea are well settled. Article II, Sections 24 and 26, 1972 Montana Constitution, protect the right of a criminal defendant to a trial by jury.
Section 46-12-204, MCA, states in pertinent part:
"(1) The defendant shall enter a plea of guilty or not guilty to the indictment, information or complaint. If the defendant refuses to plead to the indictment, information, or complaint, a plea of not guilty must be entered.

*1053 "(2) The court may refuse to accept a plea of guilty and shall not accept the plea of guilty without first determining that the plea is voluntary with an understanding of the charge."
Further, section 46-16-105(2), MCA, provides:
"At any time before or after judgment the court may, for good cause shown permit the plea of guilty to be withdrawn and a plea of not guilty substituted."
There is no precise rule which can be relied upon in any given case to withdraw a guilty plea. State v. Lewis (1978), Mont., 582 P.2d 346, 352, 35 St.Rep. 1089, 1096. Each case must be examined on its own record. State v. Griffin (1975), 167 Mont. 11, 21, 535 P.2d 498, 503. We must rely on the discretion of the trial court. "... That discretion is subject to review only upon the showing of an abuse of discretion." State v. Lewis, supra, 582 P.2d at 352.
"`A plea of guilty will be deemed involuntary where it appears that the defendant was laboring under such a strong inducement, fundamental mistake, or serious mental condition that the possibility exists he may have plead guilty to a crime of which he is innocent.' ... "If, however, there is any doubt that a plea is not voluntary, the doubt should be resolved in the defendant's favor. On application to change a plea, all doubts should be resolved in favor of a trial on the merits." State v. Huttinger (1979), Mont., 595 P.2d 363, 367, 36 St.Rep. 945. (Citations omitted.)
In Huttinger this Court held that there are three important considerations involved in a criminal defendant's attempt to withdraw a previously entered plea of guilty:
"... (1) the adequacy of the interrogation by the District Court of the defendant at the entry of the guilty plea as to the defendant's understanding of the consequences of his plea, (2) the promptness with which the defendant attempts to withdraw the prior plea, and (3) the fact that the defendant's plea was apparently the result of a plea bargain in which the guilty plea was given in exchange for dismissal of another charge ..." 595 P.2d at 366.
Here, we are only concerned with the first factor as defendant's motion to withdraw his plea was timely and the court refused to accept the plea bargain agreement when presented to the court.
While the interrogation here was more complete than in Huttinger, defendant did not admit that he had committed an aggravated assault, nor did he declare the facts upon which his plea of guilty was based. Here, the interrogation by the judge concerning the incident went as follows:
"THE COURT: You are aware of the nature of this charge against you and that it could be up to 20 years at hard labor in the State Prison?
"THE DEFENDANT: Yes, sir.
"THE COURT: Are you satisfied with the services rendered by your attorney, Mr. Bartlett?
"THE DEFENDANT: Yes, sir.
"THE COURT: Mr. Bartlett, are you satisfied that the Defendant is entering this plea voluntarily?
"MR. BARTLETT: Yes, sir.
"THE COURT: Now, even though you have the right to remain silent, as I stated, I won't accept a plea of guilt unless there is a factual basis justifying such plea, so I'm going to ask you, did you, on September 17, 1978, discharge a Smith & Wessons Model 59 pistol at a Harold Keller?
"THE DEFENDANT: I was highly intoxicated at the time, your Honor, and I'm not sure  I don't recall the actual events that happened.
"THE COURT: Did you have a pistol with you?
"THE DEFENDANT: Yes, sir.
"THE COURT: And was it discharged?
"THE DEFENDANT: Yes, sir.
"THE COURT: Now, prior to this time, I assume that your attorney knew of  had access to the County Attorney's file as to the police investigation?
"THE DEFENDANT: Yes, sir.

*1054 "THE COURT: What had you been drinking at the time?
"THE DEFENDANT: Vodka and orange juice.
"THE COURT: And how long?
"THE DEFENDANT: About 12, 14 hours.
"THE COURT: Now, who else was there, do you recall?
"THE DEFENDANT: No, just myself.
"THE COURT: Do you know where the gun was discharged from?
"THE DEFENDANT: Yes, sir.
"THE COURT: And where was it?
"THE DEFENDANT: On LaSalle Road.
"THE COURT: And why was it discharged, do you know?
"THE DEFENDANT: No, sir.
"THE COURT: Who is Allen Baker?
"THE DEFENDANT: I have no idea, sir.
"THE COURT: Harold Keller?
"THE DEFENDANT: I don't know him either.
"THE COURT: You have never met him before?
"THE DEFENDANT: No.
"THE COURT: But this was the person involved with the discharge of the gun?
"THE DEFENDANT: Yes, sir.
"THE COURT: Well, under these circumstances, at the time of the hearing, I think that Mr. Keller should be here in order that the circumstances be more fully known to the Court ..."
The court at this time properly refused to accept defendant's guilty plea. It did, however, accept it without further interrogation of defendant after hearing the testimony of the victim on March 8, 1979.
While this case involves an aggravated assault, it has the same problems and defects that were pointed out in State v. Azure (1977), Mont., 573 P.2d 179, 34 St. Rep. 1569, and reiterated in Huttinger.
Here, defendant was not made aware of the differing elements of assault as set forth in sections 45-5-201 and 45-5-202, MCA. The District Court had before it evidence indicating the defendant was under the influence of a combination of drugs and alcohol and was possibly suffering from mental distress or instability. These mitigating circumstances may have prevented the defendant from being able to commit an aggravated assault as defined by statute.
"`* * * Real notice and understanding by a defendant of the true nature of the charge against him is the first and most universally recognized requirement of due process * * * Understanding of the nature of the charge is indispensable to a valid plea of guilty * * *'" State v. Azure, supra, 573 P.2d at 183.
The transcripts indicate defendant actually remembered the facts surrounding the alleged assault. From statements made by his original counsel, it appears defendant testified contrary to these facts because of his mistaken interpretation of counsel's advice that he was to advise the court he was too intoxicated to remember the details surrounding the alleged assault. It appears that defendant, who was a newcomer to the criminal justice system, clearly misunderstood not only the advice of counsel, but the ramifications of failing to tell the truth. The attorney, however, should have taken steps to protect his client from a situation of this kind, if not immediately, at least before the second hearing.
Matters were further complicated, however, when defendant's original attorney became ill and one of his associates, who was unfamiliar with the facts, assumed the case shortly before the second hearing. At the second hearing, no evidence was introduced by defense counsel to contradict the testimony of the victim, although defendant clearly had a different version of the incident. The judge accepted the plea without ever hearing defendant's version.
This is an unfortunate chain of circumstances which should not happen in our criminal justice system. If the matter was properly understood by the judge in the first instance, it is conceivable that the judge would not have accepted defendant's plea, there being real questions concerning *1055 whether or not an aggravated assault was actually committed.
The second issue before this Court is whether the District Court erred in determining that the mandatory two-year sentence provision for aggravated assault under section 45-5-202(2), MCA, must apply here.
Section 45-5-202(2), MCA, states:
"A person convicted of aggravated assault shall be imprisoned in the state prison for a term of not less than 2 years or more than 20 years, except as provided in XX-XX-XXX."
Section 46-18-222, MCA, provides in pertinent part:
"All mandatory minimum sentences prescribed by the laws of this state ... do not apply if:
"...
"(2) the defendant's mental capacity, at the time of the commission of the offense for which he is to be sentenced, was significantly impaired, although not so impaired as to constitute a defense to the prosecution;
"...
"(5) where applicable, no serious bodily injury was inflicted on the victim."
Both parties agree that the District Court erred and that the exemptions enumerated above apply.
The transcripts are replete with testimony that the defendant was very drunk on the night of the incident. This testimony, however, may be viewed differently by reasonable men as it concerns intent. Yet, whether defendant could or could not form the necessary intent is of no consequence here, as the exception in subsection (5) above enumerated is applicable. Although a loaded weapon was involved and although section 46-18-221(1), MCA, provides for a minimum sentence for crimes committed with a firearm, this section is also subject to the exceptions of section 46-18-222.
In the last legislative session, section 46-18-222(5) was amended so that the exception involving absence of serious bodily injury is inapplicable if a weapon is used in the crime, even if no serious bodily injury is inflicted. Chapter 396, Section 1, Laws of Montana (1979). This amendment, however, did not become effective until July 1, 1979, and therefore cannot be retroactively applied to persons committing crimes prior to that date. State v. Azure, supra, 587 P.2d at 1297.
Therefore, on the facts and time frame of this case, the District Court erred in finding section 46-18-222(5) inapplicable.
The judgment of the District Court is reversed, and the sentence imposed on that judgment vacated and set aside. The cause is remanded to the District Court with instructions to permit defendant to withdraw his previously entered plea of guilty and enter his plea of not guilty to the crime charged.
HASWELL, C.J., and HARRISON, SHEA and SHEEHY, JJ., concur.
