
630 N.W.2d 411 (2001)
In the Matter of the WELFARE OF M.P.Y.
No. C7-99-2017.
Supreme Court of Minnesota.
July 26, 2001.
*412 Michael F. Crommett, Asst. State Public Defender, Minneapolis, for appellant.
Michael Hatch, Atty. Gen., St. Paul, Amy Klobuchar, Hennepin County Atty., David C. Brown, Asst. County Atty., Minneapolis, for respondent.
Heard, considered, and decided by the court en banc.

OPINION
LANCASTER, Justice.
Appellant, 16-year-old M.P.Y., was charged with two counts of first-degree aggravated robbery in an extended jurisdiction juvenile (EJJ) delinquency prosecution. A jury convicted him of both counts, and he was sentenced to two concurrent sentences of 48 months. The sentencing *413 judge ordered that M.P.Y. be placed in Glen Mills Academy. Pursuant to the rules of juvenile procedure, M.P.Y.'s 48-month adult sentence was stayed contingent upon cooperation with the conditions of placement at Glen Mills, compliance with the EJJ probation terms upon release from Glen Mills, and continued law abiding behavior. See Minn. R. Juv. P. 19.08.
M.P.Y. appealed, arguing, among other things, ineffective assistance of counsel and improper preclusion of his alibi testimony. The court of appeals declined to reach the claim of ineffective assistance of counsel, and affirmed the trial court's decision to preclude M.P.Y.'s alibi testimony. We granted review on both of these issues.
On October 16, 1998, shortly before 9:00 p.m., two men robbed a Tom Thumb convenience store located on the corner of Cedar and 37th Street in Minneapolis. A cashier and a manager were working at the store at the time of the robbery. The cashier was behind the register and the manager was filling a cooler when the robbery ensued. Both assailants wore dark clothes, dark hats, and had bandanas covering their faces. One assailant went behind the counter and demanded that the cashier open the cash register, while the other assailant stood at the door, pointing a silver handgun at the cashier. When the manager came out of the cooler, the assailant by the register said "[w]atch him. Watch him." The cashier opened the register and the assailant took the money out of the register and put it in a black garbage bag. The cashier stated that there was less than $200 in the register, but he did not know the exact amount. Both assailants then ran out the door, and the manager called the police. The manager testified that the suspects ran north through an alley when they left the store. As they ran out the door, the suspects dropped several $1 bills. A videotape from a surveillance camera confirmed these events.
The manager described one of the assailants as tall and thin and the other as shorter and heavier. The taller assailant was the one standing at the door with the gun. M.P.Y. fit the description of the taller assailant. The manager also described the suspects as Hispanic, based on their skin color and the hair that was visible under their caps. Investigators were not able to recover any fingerprints that matched the suspects.
A description of the robbery and the suspects was dispatched over Minneapolis police radios just before 9:00 p.m. An investigator found a black plastic bag and ten $1 bills in the alley just north of the store. Another officer found a dark jacket, two bandanas, a silver pellet gun, a pair of brown gloves, a black stocking cap, a black pullover and some crumpled up $1 bills just northwest of the convenience store. Two additional officers in a squad car headed north from the Tom Thumb and then west to begin looking for suspects. At about 9:10 or 9:15 p.m., the two officers in the squad car saw two males, one taller and thinner and the other shorter and stockier, coming out of an alleyway wearing dark clothing. When the two pedestrians saw the police, they put their heads down as if they did not want to be seen. The officers pulled over and ordered the suspects to the ground at gunpoint. The suspect identified as M.P.Y. removed and threw to the ground a black knit cap that he was wearing.
Both suspects were breathing heavily and sweating although it was a cool evening. One of the officers described the suspects as appearing very nervous, looking at each other when the officers asked them questions. The second suspect had $117 in small bills wadded up in his pocket. Both suspects were arrested for aggravated *414 robbery. After booking the suspects, a cylinder fitting the pellet gun found earlier was found in the second suspect's pocket.
M.P.Y. was charged with two counts of first-degree aggravated robbery. His case was certified for an EJJ proceeding and was tried to a jury in Hennepin County District Court. The state requested notice of defenses and details of witnesses to any defense of alibi nearly a month before trial.
At the beginning of trial, M.P.Y.'s counsel gave a very brief opening statement. In it he said, "[o]n the night of October 16th * * * [M.P.Y.] was hanging out with a buddy of his * * *. They went to visit an aunt at approximately 33rd and 16th street. * * * And that's where they were on the evening hours between about 8 and 9 o'clock." At the end of defense's opening statement, the prosecution requested to approach the bench and a discussion was held off the record. Based on a later reference to this discussion, it appears the discussion involved an objection to an alibi reference in the opening statement. The court did not issue any corrective instruction.
Two days later, after presenting four witnesses, the prosecutor made a record of his earlier objection to any alibi testimony while the jury was out of the courtroom. The prosecutor noted that, as of the beginning of trial, the state had not received any witness list or "notice of a defense." In response to the state's objection, defense counsel stated that he only intended to call the defendant as a witness. In his argument before the judge, the prosecutor specifically recalled telling defense counsel that if the defendant was going to present an alibi defense, the state was entitled to notice, and the defense did not dispute this statement. Counsel for M.P.Y. did not respond to the request for notice. The prosecutor argued that because he had not been given notice as required under Minn. R.Crim. P. 9.02, subd. 1(3), and thus had been precluded from investigating the alibi, the defendant should not be allowed to offer testimony regarding where he was at the time of the robbery. The state referred to the part of defendant's opening statement that said that the defendant was at an aunt's house between 8 and 9 o'clock (the time of the robbery), and argued that this was an alibi.
Defense counsel replied that it was not his intention to call any alibi witness. Rather, he intended to explain the route M.P.Y. was taking when he was arrested, and this required the defendant to explain that he had been coming from an aunt's house. Defense counsel admitted that he made a mistake and did not know that this was an alibi.[1] He also argued that he did not see how the state would be prejudiced by the lack of notice, because no other witness would be called to corroborate the defendant's testimony. The trial court ruled that this was clearly an attempt to offer an alibi and that any testimony regarding where M.P.Y. was immediately preceding or at the time of the crime would not be allowed. The court reasoned that the state was not given the opportunity to investigate the alleged alibi and that it would be "unprepared to counter [the] testimony." The defendant did not make an offer of proof as to the substance of the alibi testimony.
*415 Later, as M.P.Y. was testifying, he was asked whether and how he knew about the money found in his companion's pocket. He responded that he knew about the money "[b]ecause we went to a cashget his check cashed by his aunt." The state objected and the judge sustained the objection and ordered that the answer be stricken. At the same time, appellant said, "[o]h, yeah, I can't say that," indicating that he had been instructed not to testify as to where he was before he was arrested. Appellant further testified that he was not involved in the robbery and that he was "nowhere near" the Tom Thumb that night.
The jury found M.P.Y. guilty of two counts of aggravated robbery in the first degree, and he was sentenced to two concurrent terms of 48 months, the presumptive sentence. Pursuant to the rules of juvenile procedure, the 48-month adult sentence was stayed conditioned on M.P.Y.'s compliance with the terms of his placement at Glen Mills Academy, lawful behavior for the duration of the sentence, and compliance with the terms of his EJJ probation upon release from Glen Mills. See Minn. R. Juv. P. 19.08.
Before we can reach the substantive issue of this case, we must first address the issue of forfeiture, because appellant did not make an offer of proof when his testimony was not allowed. "We have held that a party fails to preserve for appeal a ruling excluding evidence when that party fails to make an offer of proof showing the nature of the evidence excluded." State v. Wolf, 605 N.W.2d 381, 385 (Minn.2000). Minnesota Rules of Evidence 103(a)(2) states in relevant part that error may not be predicated upon a ruling that excludes evidence unless a substantial right of the party is affected and "the substance of the evidence was made known to the court by offer [of proof] or was apparent from the context within which questions were asked." In this case, the ruling at issue affects a substantial right of the appellant, his right to testify on his own behalf and his right to present a defense. Both the United States Supreme Court and this court have held that the defendant's right to testify in his own defense is protected by the Fourteenth Amendment Due Process Clause. Rock v. Arkansas, 483 U.S. 44, 49, 51, 107 S.Ct. 2704, 97 L.Ed.2d 37 (1987); State v. Ihnot, 575 N.W.2d 581, 587 (Minn.1998).
M.P.Y.'s claim also meets the second prong of Minnesota Rules of Evidence 103(a)(2). Although no offer of proof was made, the substance of the precluded testimony was apparent. M.P.Y.'s defense attorney stated in his opening statement that appellant was at an aunt's house between 8 and 9 o'clock, the time of the robbery. The defense attorney stated that he "intended to offer * * * the route [his] client was taking when he was arrested: Where he was coming from. Where he was going to. Thus, how he landed at the specific spot at which he was arrested." Because the statements of the defense attorney revealed the substance of M.P.Y.'s intended testimony in this case, a formal offer of proof was not necessary to preserve the issue for appeal.
M.P.Y. argues that it was an abuse of discretion for the trial court to preclude his alibi testimony. We review evidentiary rulings under an abuse of discretion standard. State v. Kelly, 435 N.W.2d 807, 813 (Minn.1989). If the exclusion of evidence violated the defendant's constitutional right to present a defense, we will reverse the conviction unless the error is found to be harmless beyond a reasonable doubt. Id. Appellant argues that the trial court's decision to preclude his alibi testimony violated his right to present a defense.
*416 Minnesota Rules of Juvenile Procedure 10.05, subd. 1(C)(1), states in part that upon the prosecuting attorney's request, the child's counsel must disclose in writing any defense, other than denial, including alibi.[2] Subdivision 1(C)(4) states in part that if the child intends to offer evidence of an alibi, the child's counsel shall inform the prosecutor of the specific place or places where the child contends he was when the alleged delinquent act occurred. It is not disputed that appellant's trial counsel failed to give the required notice regarding M.P.Y.'s alibi. Therefore, the issue for us to determine is whether it was an abuse of the trial court's discretion to preclude the alibi testimony as a sanction for violation of the notice provision.
Minnesota Rules of Juvenile Procedure 10.06, subd. 7(A), sets forth the sanctions for violating the rules of discovery. If it comes to the attention of the court that either party violated the discovery rules, "the court may upon motion, order discovery or inspection, grant a continuance, or enter such order as it deems just in the circumstances." Minn. R. Juv. P. 10.06, subd. 7(A).
Although we have held that preclusion of witness testimony is a valid sanction for discovery violations, this case presents us with a more difficult question because it is the defendant's testimony that was precluded. As we stated earlier, the Fourteenth Amendment protects a defendant's right to testify in his own defense. See Rock, 483 U.S. at 49, 51, 107 S.Ct. 2704; Ihnot, 575 N.W.2d at 587.
The United States Supreme Court held in Rock that although a defendant has a right to testify on his own behalf, his testimony can be limited to "accommodate other legitimate interests in the criminal trial process." 483 U.S. at 55, 107 S.Ct. 2704. However, "restrictions of a defendant's right to testify may not be arbitrary or disproportionate to the purposes they are designed to serve." Id. at 56, 107 S.Ct. 2704.
Because a defendant has a constitutional right to testify on his own behalf, safeguards exist to ensure that this right is not violated. For example, the right to testify is personal and cannot be waived by counsel. State v. Rosillo, 281 N.W.2d 877, 878 (Minn.1979). Additionally, the waiver of the right to testify must be voluntary and knowing. State v. Walen, 563 N.W.2d 742, 751 (Minn.1997). Although it is not required in this state, it is also common for a trial court to confirm with the defendant on the record that his waiver of the right to testify is knowing and voluntary. See id. at 751-52.
Because we are careful to protect a defendant's right to testify, we are particularly cautious in reviewing a court's decision to preclude a defendant's testimony. See Rock, 483 U.S. at 57-58, 107 S.Ct. 2704 (applying a heightened constitutional analysis where the court excluded a defendant's, rather than a witness's, testimony). In this case, the district court's decision to preclude the defendant's testimony cannot be arbitrary or disproportionate to the purpose the sanction was meant to serve. See id. at 58, 107 S.Ct. 2704. If we find that the district court's decision was an abuse of discretion because it did not meet this standard, we must reverse the conviction unless we conclude that the error was harmless beyond a reasonable doubt. See Kelly, 435 N.W.2d at 813.
*417 The United States Supreme Court has upheld the preclusion of witness testimony as a sanction where a party willfully violated a discovery rule to gain a tactical advantage. Taylor v. Illinois, 484 U.S. 400, 108 S.Ct. 646, 98 L.Ed.2d 798 (1988). In Taylor it was not the defendant, however, who was precluded from testifying. Id. at 406, 108 S.Ct. 646. In that case, on the second day of trial, the defendant moved to amend his witness list, adding two witnesses who allegedly witnessed the incident that led to the attempted murder with which the defendant was charged. Id. at 403, 108 S.Ct. 646. The defendant's counsel claimed that he had just been informed about the witnesses. Id. After further inquiry and an offer of proof involving the full testimony of a witness, the trial court found that there was a willful violation of the discovery rules and did not allow the testimony. Id. at 405, 108 S.Ct. 646. Upon review, the Court held that there are situations where preclusion of testimony is a proper sanction for discovery violations. See id. at 415, 108 S.Ct. 646. In Taylor, the Court found that there was willful misconduct deserving of the "severest sanction." Id. at 417, 108 S.Ct. 646.
In upholding a Florida notice of alibi statute, the Supreme Court also held that, "[g]iven the ease with which an alibi can be fabricated, the State's interest in protecting itself against an eleventh-hour defense is both obvious and legitimate." Williams v. Florida, 399 U.S. 78, 81, 90 S.Ct. 1893, 26 L.Ed.2d 446 (1970). In that case, the appellant argued that the notice of alibi requirement violated his Fifth Amendment right against self incrimination. Id. at 82, 90 S.Ct. 1893. The Supreme Court rejected the argument and held that the notice of alibi statute was a valid discovery rule. See id. at 85-86, 90 S.Ct. 1893.
We have previously examined preclusion of alibi witness testimony as a sanction for violating the discovery rules. In State v. Lindsey, we upheld a trial court's decision to preclude the testimony of a defense witness and to strike another's partial testimony because the witnesses had not been disclosed to the state. 284 N.W.2d 368, 372, 373 (Minn.1979). We recognized the essential role that pretrial discovery plays in the criminal justice system, noting that it "avoids surprise, discourages false defenses, and aids in the detection of perjury by witnesses." Id. at 372-73. We stated that imposing sanctions for violations of the discovery rules is a matter particularly suited to the discretion of the trial court. Id. at 373. In exercising this discretion, the trial court "should take into account: (1) the reason why disclosure was not made; (2) the extent of prejudice to the opposing party; (3) the feasibility of rectifying that prejudice by a continuance; and (4) any other relevant factors." Id.
Under the first factor, the defense attorney in this case admitted that the reason he did not disclose M.P.Y.'s alibi defense was because he made a mistake. However, a defense attorney has an obligation to understand the basic rules of discovery. Counsel for M.P.Y. should have understood his duty to disclose M.P.Y.'s alibi testimony from a simple reading of Minn. R. Juv. P. 10.05, subd. 1(C)(1). In Taylor, the Supreme Court upheld preclusion of witness testimony as a sanction where there was willful discovery misconduct. 400 U.S. at 402, 91 S.Ct. 431. This court has gone as far as to uphold the preclusion of witness testimony where there was not necessarily bad faith, but where there was an unjustified disregard of the discovery obligation. See Lindsey, 284 N.W.2d at 373. In the case at hand, it appears that there was an *418 unjustified disregard of the discovery obligation. In Taylor, when reviewing the reason why disclosure was not made, the Supreme Court also considered the simplicity of compliance with the discovery rule that was at issue. 484 U.S. at 415, 108 S.Ct. 646. We also find the simplicity of complying with rule 10.05, an elementary discovery rule, a relevant factor in our analysis.
As to the second factor listed in Lindsey, M.P.Y. argues that it is questionable whether the state suffered any prejudice from the nondisclosure because the state, in order to prove guilt beyond a reasonable doubt, had the burden of proving that appellant was at the scene of the robbery. The state responds that testimony by M.P.Y. that he was somewhere else at the time of the crime could raise some question or doubt in the jury's mind. The trial court pointed out the state would have no opportunity to counter the alibi testimony if it was allowed. If the state had the opportunity to investigate the alibi and cross-examine or otherwise impeach the defendant, the danger of doubt borne of unfair surprise could be eliminated. Therefore, although the state has the burden of proving the defendant was present at the scene of the crime, the state can still be prejudiced by being denied the opportunity to investigate an alibi.
One of the purposes of the disclosure of alibi rule is to avoid the type of surprise that was present here. See Lindsey, 284 N.W.2d at 372-73. This type of discovery rule increases the information available to both parties and enhances the fairness of trial. Id. Another purpose is to minimize the costs of criminal litigation. Id. These purposes are thwarted if the state has to assume that it can be faced with surprise alibi testimony at trial, and engage in virtually endless pretrial investigation in order to be prepared for each possible alibi.
This leads us to the third factor we considerthe feasibility of rectifying the prejudice by ordering a continuance. There is no evidence in the record that the trial court considered a continuance or that the state requested one. In fact, the record is devoid of any indication that the state made any effort to investigate the alibi. As explained earlier, we carefully guard the rights of a criminal defendant. Thus, in accordance with Lindsey, the trial court was required to consider the feasibility of ordering a continuance to rectify any prejudice suffered by the state. 284 N.W.2d at 373. We conclude that the trial court abused its discretion by denying M.P.Y. the right to testify on his own behalf without first considering whether a continuance would rectify any prejudice that the state might suffer as a result of the defense attorney's omission.
It is not clear in this case why it was not feasible to rectify any prejudice by ordering a continuance. Even a continuance of one day might have allowed the state to investigate any alleged alibi. Further, the possibility of M.P.Y. offering alibi testimony was apparent as early as the opening argument when the state made its objection. If for some reason the trial court thought that a continuance was not a feasible solution, this should have been stated on the record so it would be evident that a continuance was at least considered. In the absence of a record identifying compliance with the Lindsey factors, we cannot be confident that the sanction was not disproportionate to the purpose it was meant to serve. We conclude, therefore, that the preclusion of M.P.Y.'s testimony was an abuse of discretion.
Although we conclude that it was unconstitutional to preclude M.P.Y.'s testimony, we will not remand this case for a new trial if the error was harmless beyond a reasonable doubt. Chapman v. *419 California, 386 U.S. 18, 23-24, 87 S.Ct. 824, 17 L.Ed.2d 705 (1967). When constitutional errors are involved, the state has the burden of proving that the error did not contribute to the jury's verdict. State v. Conklin, 444 N.W.2d 268, 275 (Minn. 1989). "If the verdict actually rendered was surely unattributable to the error, the error is harmless beyond a reasonable doubt." State v. Jones, 556 N.W.2d 903, 910 (Minn.1996).
At trial, M.P.Y. was allowed to testify that he was not involved in the robbery of the Tom Thumb, nor was he anywhere near the Tom Thumb on the night of the robbery. However, M.P.Y. was not allowed to testify that he was at an aunt's house between 8 and 9 o'clock when his companion cashed a check. Such testimony would have provided the jury with a reason why M.P.Y.'s companion had the money that was found in his pocket. We are not convinced beyond a reasonable doubt that the preclusion of this testimony did not have any impact on the jury's verdict of guilty. Additionally, the evidence in this case was circumstantial, and a reasonable jury might not be convinced of guilt beyond a reasonable doubt in light of M.P.Y.'s precluded testimony. Furthermore, the defendant's credibility was damaged because the state and the court did not address the statement regarding an alibi as soon as it was made in the defendant's opening statement. After the opening statement was complete, the state presumably objected off the record to the lack of notice of an alibi defense, but the judge did not issue any curative instruction. When M.P.Y. appears to have tried to testify that he was at an aunt's house, he was interrupted with an objection and responded, "[o]h, yeah, I can't say that." For these reasons, we cannot say that the guilty verdict was surely unattributable to the district court's error and, therefore, we cannot conclude that the district court's error was harmless beyond a reasonable doubt. We hold that the exclusion of M.P.Y.'s testimony was error and the error was not harmless beyond a reasonable doubt. We reverse the court of appeals' decision and remand this case to the district court for a new trial. Because we are remanding this case for a new trial, it is not necessary for us to address appellant's ineffective assistance of counsel claim.
Reversed and remanded.
NOTES
[1]  Counsel's actual statement was "[t]his somewhat, I would say, a mistake of thinking on my part. * * * My thinking has been that known to an alibi [sic], if it does, then my thinking is incorrect." In any case, M.P.Y. argued in his brief that defense counsel's failure to disclose the alibi testimony was due to his ignorance of the fact that the defendant's own testimony as to where he was at the time of the crime was considered an alibi.
[2]  In district court, the parties and the court analyzed the issue under Minnesota Rules of Criminal Procedure 9.02, subd. 1(3)(a). The court of appeals addressed the juvenile rule. Both rules require a defendant to give notice of an alibi defense and notice of specifically where the defendant was at the time of the crime.
