
491 P.2d 858 (1971)
94 Idaho 477
STATE of Idaho, Plaintiff-Respondent,
v.
Kenneth MOEN et al., Defendants-Appellants.
No. 10554.
Supreme Court of Idaho.
December 16, 1971.
*859 Rayborn, Rayborn, Webb & Pike, Twin Falls, for appellants.
W. Anthony Park, Atty. Gen., Martin R. Ward, Deputy Atty. Gen. and Charles P. Brumbach, Asst. Atty. Gen., Boise, for respondent.
DONALDSON, Justice.
This is an appeal by three defendants  Kenneth Moen, Earl S. Carver, and Patrick Joseph Kinner (also known as Ernest Larry Ware)  who were convicted of the crime of escape by one charged with a felony.[1] After a jury trial held in the District Court of the Fifth Judicial District in and for the County of Twin Falls in July, 1969, they were sentenced to imprisonment for terms not to exceed five years. The defendants appeal their convictions on the ground that they were denied a fair and impartial trial in several respects.
In the presence of the panel of prospective jurors, counsel for the defendants requested that the defendants' handcuffs be removed. The trial judge asked the advice of the sheriff, who advised against it, and the motion was denied.
Immediately after opening statements were made, the prosecuting attorney introduced certified copies of executive warrants issued by the Governor of Nevada; these warrants had been issued upon the request of the State of Idaho for a robbery committed in Twin Falls County. Also introduced with the warrants was an exemplified copy of the minutes of a Nevada court proceeding in which the validity of these warrants was upheld. Counsel for the defendants did not object to this evidence.
On direct examination, the sheriff testified that at the time of their escape these defendants were being held in the Twin Falls County Jail on a charge of robbery and that subsequently they had been arrested for a burglary committed after their escape. On the defendants' motion, the trial court instructed the jury to disregard any mention of the burglary charge. The court did not instruct them to disregard the testimony concerning the robbery charge because it was relevant to show that these defendants were charged with a felony at the time of escape, which was an element of the crime for which they were being tried, but the court did advise the *860 jury that the defendants were being tried for the crime of escape and not for any alleged robbery or burglary.[2] At the close of the state's case, the defendants moved to dismiss on the ground that they were illegally incarcerated at the time of their escape; after allowing the defense to make an offer of proof concerning the illegality of defendants' custody, the trial court denied this motion. Defense counsel then informed the court that the only evidence he had planned to put on in defense had to do with the illegality of custody, and since the court had already ruled on the issue, the defense rested without presenting any proof to the jury.

I.
The appellants' first contention is that they were denied a fair and impartial trial because they were forced to wear handcuffs at trial. Prior to voir dire examination, but in the presence of the entire panel of prospective jurors, the following dialogue between court and counsel took place:
"DEFENSE COUNSEL: Your Honor, the defendants have asked if it's at all possible that they have their handcuffs removed?
THE COURT: I will ask the advice of Sheriff Corder.
PROSECUTING ATTORNEY: The sheriff advises against it.
THE COURT: Very well. Your motion will be denied."
The law applicable to the issue raised by the appellants is concisely summarized in 23 C.J.S. Criminal Law § 977 (1961):
"During the trial accused should, as a general rule, be free from shackles, except in so far as the trial court, in its sound discretion, deems them necessary to prevent the escape of accused or his forcible release, to restrain him from doing violence to others, or from injuring himself, or to prevent such misconduct as would obstruct the work of the court; and such exceptions apply particularly while accused is being brought into or taken from court. If accused is shackled without such necessity, it is reversible error, unless it is clear that no prejudice in the minds of the jury was caused thereby."
Furthermore, when reasonable precautions are taken to retain custody of the accused, the fact that they indicate to the jury that the defendant is a prisoner and perhaps a dangerous character does not deprive him of a fair trial. People v. Ross, 67 Cal.2d 64, 60 Cal. Rptr. 254, 429 P.2d 606 (1967), rev'd on other grounds, 391 U.S. 470, 88 S.Ct. 1850, 20 L.Ed.2d 750 (1968); People v. Burwell, 44 Cal.2d 16, 279 P.2d 744 (1955), cert. denied, 349 U.S. 936, 75 S.Ct. 788, 99 L.Ed. 1265 (1955).
Although the sheriff has some initial responsibility for determining whether an accused should be handcuffed during a jury trial, the trial judge must, in fulfilling his duty to preside over the trial, decide the question for himself. People v. Mendola, 2 N.Y.2d 270, 159 N.Y.S.2d 473, 140 N.E.2d 353 (1957); State v. McKay, 63 Nev. 118, 165 P.2d 389 (1946), rehearing denied, 63 Nev. 118, 167 P.2d 476 (1946). In exercising his discretion, the judge need not rely only upon evidence formally offered and admitted at trial. His knowledge may properly stem from official records or what law enforcement officers have told him. State v. McKay, supra. In addition, the trial court may take judicial notice of facts generally known within the limits of its jurisdiction. State v. McKay, supra; Makley v. State, 49 Ohio App. 359, 197 N.E. 339 (1934). However, the information relied upon should be shown on the *861 record before trial and out of the presence of the jury, and the defendant should be afforded reasonable opportunity to meet that information. This will provide a record on which an appellate court can determine whether the trial judge has properly exercised his discretion  i.e., whether there were reasonable grounds for apprehension as to defendant's conduct. United States v. Samuel, 431 F.2d 610 (4th Cir.1970) (requesting that the district judge supplement the record), 433 F.2d 663 (4th Cir.1970) (final decision, per curiam), cert. denied, 401 U.S. 946, 91 S.Ct. 964, 28 L.Ed.2d 229 (1971); Woodards v. Cardwell, 430 F.2d 978 (6th Cir.1970), cert. denied, 401 U.S. 911, 91 S.Ct. 874, 27 L.Ed.2d 809 (1971); People v. Mendola, supra; see Loux v. United States, 389 F.2d 911 (9th Cir.1968), cert. denied, 393 U.S. 867, 89 S.Ct. 151, 21 L.Ed.2d 135 (1968). If defense counsel desires to object to the defendant's being brought before the court in handcuffs, he should do so before the jurors arrive or after requesting that the court excuse them. The entire matter should then be aired by a hearing, on the record, so as to enable the judge to make his determination out of the presence of the jury and to state the reasons for his decision for the appellate court.
Two separate issues are raised in connection with the trial court's refusal to remove the defendants' handcuffs: (A) Was the failure to remove the handcuffs an abuse of discretion? If not (as we hold), then the fact that the defendants were initially brought before the jury panel handcuffed clearly does not constitute prejudicial error. (B) Was the consideration and denial of the motion to remove the defendants' handcuffs  in the presence of the jury panel  prejudicial error in this case? We hold that it was not.

A.
The fact that the trial court in this case did not follow the procedure outlined above does not entitle the defendants to a new trial upon the ground that the court prejudicially abused its discretion where, as here, the record itself sufficiently justifies the court's refusal to order the handcuffs removed. People v. Mendola, supra. As the New York Court of Appeals said in Mendola:
"It may be that in determining whether handcuffs are reasonably necessary in a given case, the better practice would be for the trial judge to take testimony as to the necessity for the handcuffs and state for the record his reasons for confirming the decision of the Sheriff in that respect. Such procedure would undoubtedly facilitate a review by the appellate courts of the trial court's determination. However that may be, the fact that the trial court has not followed what might be considered the `better practice' before approving the Sheriff's action, cannot serve to justify the ordering of a new trial upon the ground that the trial court has prejudicially abused its discretion as a matter of law where, as here, it appears from the record itself that the Sheriff had reasonable cause for handcuffing the accused. The fact that we are unable to determine from the record how detailed a knowledge of the facts of the escape and of defendant's compulsive urge to escape from custody the trial court possessed, is not dispositive. What is dispositive is the fact that the record reveals sufficient evidence to justify the trial court's refusal to order the handcuffs removed from Mendola." 159 N.Y.S.2d at 478, 140 N.E.2d at 356.
Turning our attention to the record presented on this appeal, we note that the situation with which the trial court was faced strongly dictated that it refuse to remove the defendants' handcuffs. These defendants were on trial for having escaped from the Twin Falls County Jail. Only two days before this trial, in the same jurisdiction, they had been convicted of burglary, thereby giving them a strong motive for making another escape attempt. In addition, the very fact that there were three defendants here made the risk of an *862 escape attempt greater, with the concomitant increased danger to those present in the courtroom and to the public generally. We must evaluate these facts with the following notion in mind:
"It is too obvious for argument that hardly any other matter can better be relegated to the discretion of the trial court than that of safeguarding the court, counsel, jury, and spectators, and assuring the continued presence and attendance of the accused at the trial. Absent incontrovertible evidence of hurt, the trial court should be permitted to use such means, to secure the named ends, as the nature of the case, the known criminal record, character, associates in crime, and reputation of the accused shall reasonably call for * * *." McDonald v. United States, 89 F.2d 128, 136 (8th Cir.1937), cert. denied, 301 U.S. 697, 57 S.Ct. 925, 81 L.Ed. 1352 (1937).
The trial judge can observe firsthand the defendant's demeanor; he can take into account the mood of others both inside and outside the courtroom, and the degree of security provided by the physical facilities where the particular trial is being held. An appellate court should not lightly second-guess a trial court in regard to such matters. Again emphasizing that shackling the accused at trial is the exception and not the rule, we find no error in the court's refusal to remove the defendants' handcuffs in this case.

B.
As for the fact that the jury panel was present when the motion to remove the handcuffs was made and denied, we first point out that defense counsel at trial (who is not representing appellants on this appeal) invited error by raising the handcuffs issue in the presence of the panel of prospective jurors; in doing so, he not only called the jurors' attention to the fact that the defendants were wearing handcuffs at the time, but he also insured that from that point onward the jury would know that the sheriff and the court had made a deliberate judgment that it was necessary to keep the defendants in shackles. As pointed out above, defense counsel should not have raised the issue in the presence of the jury panel. But we do not rest our decision on the part that defense counsel played in instigating the trial court's error. What is determinative is that the error was not prejudicial in this case. A new trial will not be granted where, as here, consideration of the record as a whole reveals that justice has been done and that no other verdict could properly have been rendered. State v. Puckett, 88 Idaho 546, 401 P.2d 784 (1965); State v. Dong Sing, 35 Idaho 616, 208 P. 860 (1922); State v. Marren, 17 Idaho 766, 107 P. 993 (1910); I.C. § 19-2819; see State v. Johnson, 92 Idaho 533, 447 P.2d 10 (1968). In this case, the verdict of guilty is overwhelmingly supported by the evidence; in fact, the only defense presented at trial was that the escape was from illegal custody  a defense which (as discussed below) is no defense at all in this jurisdiction and which impliedly admits that the defendants did, in fact, escape. Hence, the presence of the jury panel when the motion to remove the defendants' handcuffs was made and denied did not deprive them of any substantial right, and this court must give judgment without regard to it. I.C. § 19-2819.[3]

II.
Appellants contend that the trial court erred when it allowed the prosecution to introduce into evidence the Nevada executive warrants and court minutes but refused to allow defendants to challenge the legality of their custody. The state contends that this evidence was properly admitted, even though it indicated other criminal acts committed by the defendants, *863 because it was admissible to show the lawfulness of the escapees' custody.
In State v. Handran, 92 Idaho 579, 448 P.2d 193 (1968), this Court held that irregularity in the proceedings leading to imprisonment does not justify escape. Under this rule, the legality of custody is not an issue in a prosecution for escape; therefore, evidence offered on this issue is immaterial, and it is equally immaterial when offered by the state (as here) as when offered by the defendant (as in Handran and here). However, the Nevada warrants were admissible to show that the defendants were charged with a felony at the time of their escape. See I.C. § 18-2505.[4] Since the defendants were on trial for the crime of "escape by one charged with a felony," evidence showing that they were charged with robbery at the time of their escape was admissible to prove an essential element of the state's case. This was the apparent reason for the admission of the testimony of the sheriff that the defendants were charged with armed robbery at the time they were booked in Twin Falls. This action was proper. Although the warrants may have been introduced for the wrong reason, they were nevertheless admissible for the reason stated herein. While the Nevada minutes upholding the validity of these warrants may not have been admissible, no prejudice resulted from the admission of this evidence, and the error, if any, was harmless. While there was the possibility of prejudice to the defendants from the admission of the Nevada warrants, in that they indicated that the defendants were charged with robbery in Twin Falls, Idaho (i.e., another offense arguably unrelated to the escape charge and showing bad acts on the part of defendants to prove them guilty of escape) this was cured by the court's advice to the jury that the defendants were being tried for escape and not for robbery or burglary.[5]

III.
Appellants allege that two prejudicial comments were made by the trial judge. Upon the state's objection to certain exhibits offered by the defense, the following colloquy took place between the court and defense counsel:
"THE COURT: Perhaps you could advise us of the purpose of these, Mr. Anderson?
MR. ANDERSON (DEFENSE COUNSEL): Well, the purpose, Your Honor, is that eventually we hope to be able to show the Court that the sheriff was not holding these men lawfully at the time they escaped from jail. And we are trying to determine the authority that he was holding them on at the time.
THE COURT: Well, I will overrule the objection * * * Exhibits 1, 2, 3, and 4 will be admitted for whatever they are worth."

Appellants contend that the emphasized words tell the jury that their exhibits were of little or no value. Whether the judge's comment had that effect we do not have to decide, for these exhibits should not have been admitted for the purpose stated by defense counsel. As we pointed out above, legality of custody is not an issue in a prosecution for escape; hence, these exhibits were immaterial, and the defendants were not prejudiced in any way by the judge's comment.
*864 The other allegedly prejudicial remark was made at the close of the state's case. The attorney for the defense indicated to the court that he had a motion he would like to make outside the presence of the jury. The trial judge responded as follows:
"THE COURT: Very well. Ladies and Gentlemen of the jury, there are some matters which the defendant's counsel wishes to call to the Court's attention which do not concern you or your duties in determining this case. While this is being done the jury will be excused and you will remain in the jury room subject to call. I expect that it probably will not be very long, but in the meantime if you will bear in mind the admonition that I have given to you just prior to our noon recess, and that was to the effect that you should not discuss this case among yourselves or with others or to discuss any of the facts or what purports to be the facts on this case, nor are you to determine the outcome of this case or the guilt or innocence of the accused until it is finally submitted to you."
Appellants' contention that the emphasized words constitute a prejudicial comment by the trial judge is wholly without merit.
Judgments affirmed.
McFADDEN and SHEPARD, JJ., and MAYNARD, District Judge, concur.
HAGAN, District Judge (dissenting).
I would agree with the law as stated in the majority opinion on the subject of recalcitrant defendants, but I disagree with its application in this case. Neither the defendants, nor their counsel, had an opportunity to make a showing, even if the burden were on them, of the lack of need for restraints, outside of the view and hearing of the jury panel. They were initially brought before the jury panel handcuffed. The motion to dispense with the restraints was made, heard and denied in the presence of the jury panel. It was at this point the presumption of innocence was damaged.
NOTES
[1]  At this trial, appellants were also convicted of injuring a public jail.
[2]  The court admonished the jury as follows: "I might advise the jury that the charges that the defendants are being tried on today are not burglary or robbery. They are charged with the crimes alleged in the information and this is what you are to determine in your final analysis, whether they are guilty of the crime as charged in the information and read to you by the clerk; not whether they are guilty or innocent [of] any alleged robbery or any alleged burglary."
[3]  I.C. § 19-2819 provides: "After hearing the appeal, the court must give judgment without regard to technical errors or defects, or to exceptions which do not affect the substantial rights of the parties."
[4]  "18-2505. Escape by one charged with or convicted of felony.  Every prisoner charged with or convicted of a felony who is confined in any jail or prison including the state penitentiary, or who while outside the walls of such jail or prison in the proper custody of any officer or person, or while at work in any factory, farm or other place without the walls of such jail or prison, who escapes or attempts to escape from such officer or person, or from such jail or prison, or from such factory, farm or other place without the walls of such jail or prison, shall be guilty of a felony, and upon conviction thereof, any such second term of imprisonment shall commence at the time he would otherwise have been discharged."
[5]  See note 2, supra.
