
313 N.W.2d 558 (1981)
STATE of Iowa, Appellee,
v.
Stanley Craig KILE, Appellant.
No. 65814.
Supreme Court of Iowa.
December 23, 1981.
*559 William R. Garretson, Des Moines, for appellant.
Thomas J. Miller, Atty. Gen., Shirley Ann Steffe, Asst. Atty. Gen., and Adrian T. Knuth, Jones County Atty., for appellee.
Considered by LeGRAND, P. J., and UHLENHOPP, HARRIS, ALLBEE, and LARSON, JJ.
UHLENHOPP, Justice.
This appeal involves several questions which arose in a prosecution for attempted murder under section 707.11, The Code 1979.
Viewing the evidence in the light most favorable to the verdict of guilty, the jury could find that defendant Stanley Craig Kile and victim Rodney McCarty were inmates in the Anamosa Men's Reformatory, that McCarty was a gambler, and that he owed Kile a gambling debt. Kile attacked McCarty and inflicted serious stab wounds which would have caused death but for prompt treatment by physicians.
The county attorney charged defendant with attempted murder, a jury found defendant guilty, and he appealed. In his appeal he advances several propositions.
I. Defendant was initially charged by complaint and brought before a magistrate. After the county attorney later filed a trial information, defendant moved to dismiss it on the following ground. Rule 2(2) of the Rules of Criminal *560 Procedure states that a magistrate shall inform a defendant, inter alia, "of the general circumstances under which the defendant may secure pretrial release...." We do not have the magistrate's minutes, but defendant contends that the magistrate did not tell him of those circumstances. We will assume arguendo that the magistrate did not do so but we cannot see how defendant was harmed; at the time he was an inmate at the Reformatory. To hold that he could obtain release would mean that reformatory inmates could secure freedom by getting themselves charged with another crime and posting bail.
Passing that point, however, defendant's remedy was not to remain silent and then raise the issue after the grand jury or county attorney charged him. His remedy, if he claimed he was wrongfully denied a right to post bail, was by writ of habeas corpus. Cf. § 811.2(6) and State v. Gilroy, 313 N.W.2d 513 (Iowa 1981) (appeal from conditions of release). We have said that "failure to have a pretrial detention determination does not void a subsequent conviction on the merits." State v. Henderson, 268 N.W.2d 173, 176 (Iowa 1978).
We hold that the magistrate's failure to inform defendant of the circumstances permitting release was not a ground under rule 10(2)(b) for dismissing the subsequent proper trial information. We do not find merit in defendant's contention.
II. Although defendant was in fact properly arraigned in Jones County where the criminal action was pending, the arraignment judge inadvertently used a written entry with a heading for Linn County. The written entry was filed in the proper criminal action in Jones County, and the action proceeded in Jones County.
At the close of the State's evidence defendant moved for an acquittal and alleged as one ground the wrong county name in the arraignment written entry. He renewed this ground in subsequent motions.
Here again we do not see how defendant was possibly harmed by this obvious mistake. The point comes within the following statement in State v. Smith, 282 N.W.2d 138, 141 (Iowa 1979):
This court has a long history of not reversing on the ground of technical defects in procedure unless it appears in some way they have prejudiced the complaining party or deprived him or her of full opportunity to make defense to the charge presented in the indictment or information.
We do not find merit in this ground for reversal.
III. The record discloses the following:
Mr. Garretson [defense attorney]: Just one more thing for the record, Your Honor, to raise that at lunch recess, Mrs. Kile observed to me that while the jurors were all out here in the hallway that her son, Stan Kile, was brought through the hallway in chains, and I think the record should show that. And apparently he was brought from the hallway in chains for the purpose of going to the men's room instead of the men's room back here where the other prisoner witnesses have been taken. I don't know why he was taken there, but, at any rate, I believe that the rule of this judicial district pertaining to chaining prisoners within the courtroom prevails, and I don't know why that prisoner was taken in chains.
The Court: What was the approximate time for the record?
Mr. Costello: This morning before court started, Judge, and both Mr. Kile and the officer who took them, both forgot we had a restroom in the back. And it was brought up after we came back, and we will use the restroom in the back from now on.
Also:
Mr. Garretson: We had a situation here, also, where the prisonersit was shown by the record here, in that the prisoner was taken before the jurors in chains, contrary to local rule and, therefore, contrary to due process of this prisoner. That all the witnesses for the Defendant were brought into this court with chains rattling right behind, Your Honor.

*561 And we filed affidavits to show this. The jury couldn't possibly have helped but have heard these chains rattling. And the fact that this was done in such a manner that it was obvious that these were people in prison attire.
Always I made it very carefully and I asked the warden to make sure these people were not dressed in prison attire so they would comply with the rule and et cetera. They were still allowed to be shown they were prisoners by the chains rattling.
Now, it's admitted, that the testimony of all these people will show that, yes, they were prisoners. They admitted they were prisoners. That's not at issue. What we have at issue here is the rule of this judicial district which says you shall not come in here attired as a prisoner unless you have the permission of the Court. Now, this man right now is attired as aI assume the Court will not object to that necessarily. We have the Court's permission. But before this jury, when we had these people come in here in chains, with the chains rattling behind you, Judge, therefore, it was a matter the same as their being attired as prisoners. Therefore, this violated the rule of this judicial district and it created overall an unfair trial for this young man, this young Defendant.
And so and upon the whole record, it is submitted that no judgment can be pronounced.
We would also state that, of course, the Defendant [sic] McCarty himself was brought in in prison attire. For what reason, I know not. The State brought him in in that fashion, and that's contrary to local rule, and he had no permission of the Court to come into court in that fashion. Whether it was for the sympathy of the jury or what or whether it was oversight, I don't know.
Prosecutor: Respecting the matter of the Defendant being in chains, I will note that local rule 4.4 states unequivocally that without the permission of the Court, the Defendant or any witness who is an inmate should not be brought in open court in chains. He was never brought into open court in chains nor were any other of the witnesses who were incarcerated in the Iowa State Men's Reformatory. The matter of him being taken to the restroom in the hallway is a matter of record. I believe at the time that matter was raised before the Court, the testimony of the gentlemen seated to your right, Mr. John Costello, was given before the Court as regards the circumstances under which Mr. Kile was taken to the men's room in the hallway instead of the men's room in the back room. As I understand it, they were in the jury room on that particular morning, not in the old judge's chambers. They were unaware that there was a restroom in the jury room, and for that reason a trip was made to the restroom. That mistake was not repeated. It is regrettable but I don't think it reaches the level of prejudicing the Defendant's case and denying of him a fair and impartial trial.
The rattling of the chains. If there was rattling of the chains, as there has to be with chains, but if it was a level that they could hear, was inadvertent. The Court will have to acknowledge at that time there were three inmates of the reformatory in that room, and there were only two guards assigned to cover them. And as a result, they necessarily have to be chained, or at least by administrative order have to be chained. And if there was rattling of the chain, it was inadvertent. And I'm sure the officers did everything they could to keep the noise at a minimum.
Also, respecting the attire of the witnesses, I'll note that all the witnesses that came in on behalf of the Defense had brand new slacks and freshly pressed and laundered white shirts. The only witness that showed up who was an inmate who didn't have the benefit of that better apparel was the State's witness Rodney McCarty. I asked the warden's office if they could explain to me after trial why it was that the Defense witnesses show up in nice white shirts and the State's *562 witness had to show up in something less than that, and I was told it was totally inadvertent.
Also, I think the reason to explain is the fact that Rodney McCarty at that time was in Oakdale at the Iowa State Mental Facilityor, Medical Facility and had recently been transferred back to the reformatory to partake in this trial. If I'm not mistaken, he was transported back to the reformatory the early afternoon of July 21, the day that trial began in that matter. I think that the recent transfer may explain, in part, why he appeared in court on that day dressed as he was. There was no intentional design on the part of the State to prejudice the Defendant's case or shed light upon the credibility of any of the witnesses by the way they were attired.
I also note, and I think Defense Counsel raised the matter, that all the testimony elicited by all the witnesses established that they were all, including the Defendant, inmates of the Iowa State Men's Reformatory. I think the purpose and the intent of Rule 4.4 is not to allow any inference or any suggestion of incarceration to be drawn by the present status or station, being their apparel or any restraints. Well, that matter or that concern is obviated by the fact that all the witnesses established that everybody is a resident of the Iowa State Men's Reformatory. The State's primary witness, Rodney McCarty, admitted that he was an inmate of the Iowa State Men's Reformatory, as did Brewster, Harris, and the third witnessinmate witness for the Defense.
Rule 4.4 of the Sixth Judicial District states:
No prisoner shall be brought into open court in handcuffs or other physical restraints, without permission of the judge.
A defendant who is in custody during trial shall be brought to the courtroom not less than fifteen minutes before court convenes each morning or at such other time as the judge may direct. Those having custody of a defendant during his trial shall take such other reasonable measures as may be necessary to avoid exposing the defendant to the view of jurors while he is in handcuffs or other physical restraints.
All prisoners brought into court for any type of court appearance shall be properly attired, and an incarcerated defendant or witness shall not be required to appear before a jury in the distinctive attire of a prisoner.
The officials did not fully comply with this rule. The victim, a witness for the State, was brought to court wearing prison attire. The prosecutor claims this happened because the victim was at the time confined in another facility. Several defense witnesses were properly brought from the reformatory to the courthouse in chains and the chains were removed before they entered the courtroom, but a dispute appears to exist as to the extent the rattling of chains was audible in the courtroom before these men entered from an anteroom. The situation regarding defendant's trip to the men's room is explained in quoted proceedings. Defendant claims these circumstances denied him a fair trial under the state and federal constitutions and the rules. Iowa R.Crim.P. 23(2)(b)(9), 23(3)(a).
A trial judge trying a case of this kind has a problem of balancing fair trial demands with security and safety. No trial is perfect. A trial judge looking back over a trial is in a better position than we are to say whether a reasonable accommodation of the two interests has been achieved; the judge is thus given considerable discretion in ruling on motions involving issues of this kind. Kennedy v. Cardwell, 487 F.2d 101 (6th Cir. 1973), cert. denied, 416 U.S. 959, 94 S.Ct. 1976, 40 L.Ed.2d 310 (1974); People v. Boose, 66 Ill.3d 261, 5 Ill.Dec. 832, 362 N.E.2d 303 (1977); Mallonee v. Lanier, 354 F.2d 940 (5th Cir. 1966); State v. Polidor, 130 Vt. 34, 285 A.2d 770 (1971); Sparkman v. State, 27 Wis.2d 92, 133 N.W.2d 776 (1965). See also Estelle v. Williams, 425 U.S. 501, 96 S.Ct. 1691, 48 L.Ed.2d 126, rehearing denied, 426 U.S. 954, 96 S.Ct. 3182, 49 L.Ed.2d 1194 (1976); State v. Evans, *563 169 N.W.2d 200 (Iowa 1969). The court acted within its discretion here. The incidents occurred outside the courtroom except that the victim, not defendant, appeared in the courtroom in prison garb. State v. Sherron, 105 Ariz. 277, 463 P.2d 533 (1970); People v. Duran, 16 Cal.3d 282, 127 Cal.Rptr. 618, 545 P.2d 1322 (1976); Williams v. Commonwealth, 474 S.W.2d 381 (Ky.1971). No showing was made that the jury was prejudicially affected or that defendant's ability to present his defense was impaired. Corley v. Cardwell, 544 F.2d 349 (9th Cir. 1976), cert. denied, 429 U.S. 1048, 97 S.Ct. 757, 50 L.Ed.2d 763 (1976); State v. Mills, 94 N.M. 17, 606 P.2d 1111 (N.M.App.1980). The exposure of the jury to observation of defendant in chains and of the witnesses in shackles was brief at most. State v. Smith, 322 So.2d 197 (La.1975); State v. Boone, 355 Mo. 550, 196 S.W.2d 794 (1946), cert. denied, 334 U.S. 823, 68 S.Ct. 1078, 92 L.Ed. 1752 (1948); Commonwealth v. Davis, 466 Pa. 102, 351 A.2d 642 (1976). Most of the incidents occurred in transporting individuals to or from the courtroom. Evans v. State, 338 So.2d 1033 (Ala.Cr.App.1976), cert. denied, 348 So.2d 784 (Ala.1977); State v. Sherron, 105 Ariz. 277, 463 P.2d 533 (1970). The alleged crime was committed while defendant was a prisoner in the reformatory; the jury was aware of that fact and also that the victim and most of the other witnesses were reformatory inmates. Commonwealth v. Brown, 364 Mass. 471, 305 N.E.2d 830 (1973).
We do not find ground for reversal here. By so holding in this case, we do not suggest that trial judges should not give full effect to the principle underlying such directives as district rule 4.4, consistent with security and safety.
IV. Defendant argues that without the testimony of the victim the evidence was insufficient to generate a fact question of defendant's guilt. We will assume the truth of this premise for the purposes of decision. Defendant also argues that the victim's testimony was inadmissible for the reason that he was not brought to court under section 622.82, The Code 1979:
A person confined in a penitentiary or jail in the state may, by order of any court of record be required to be produced for oral examination in the county where he is imprisoned and in a criminal case in any county in the state; but in all other cases his examination must be by a deposition.
Defendant misconceives the purpose of this section. The section does not constitute a rule of evidence; it provides a method of getting inmates to court. If a prison inmate is in fact in court, the admissibility of his testimony is determined in the same manner that the admissibility of the testimony of other witnesses is determined, by virtue of section 622.1 of the Code which abolishes common law incompetency of certain witnesses including felons. See McCormick's Handbook of the Law of Evidence § 64 (2nd ed. E. Cleary 1972). Defendant's contention does not have merit.
V. Defendant asserts that the trial court erred in permitting a witness, Benson, to give testimony on rebuttal which was actually proof of the State's case in chief. The record discloses, however, that Benson's testimony tended to impeach defendant's witness Harris, and also to contradict Harris's testimony. Even though Benson's testimony might also have been given in the State's case in chiefand could have been so given since it was endorsed on the trial informationthis did not render it inadmissible on rebuttal, since it contained elements of rebuttal. State v. Proulx, 252 N.W.2d 426, 432 (Iowa 1977). We find no abuse of discretion. State v. Bakker, 262 N.W.2d 538, 543 (Iowa 1978).
VI. Defendant argues, finally, that the jurors were unable to hear and did not pay attention during the trial, and supports his contention by the affidavit of his parents. We have examined the record and find that it does not substantiate this ground for reversal. Cf. State v. Cuevas, 281 N.W.2d 627, 632 (Iowa 1979) (jurors claimed to be nodding and sleeping). The trial court acted within its discretion in holding that defendant was not denied a *564 fair trial on this basis. State v. White, 223 N.W.2d 173, 177 (Iowa 1974) (trial court discretion).
We thus uphold the conviction.
AFFIRMED.
