Appeal from a judgment of *495the County Court of Schenectady County (Best, J.), rendered May 11,1983, upon a verdict convicting defendant of the crimes of rape in the first degree, sodomy in the first degree and official misconduct (two counts).
From the early morning hours of Saturday, September 12, 1981, until the morning of Monday, September 14, 1981, Dale Voorhees was incarcerated at the Schenectady County Jail pending arraignment on a charge of disorderly conduct.* During that period of time, defendant was employed as a guard at the jail. Voorhees testified that on Sunday morning, September 13, defendant, whom she identified by badge number, passed a note to her in her cell which read, “If you get out call (382-2255), let it ring. Ask for Al.” The number was the telephone number at the security office at St. Clare’s Hospital where defendant held a second job. A handwriting expert testified that the note was written in defendant’s handwriting. Voorhees testified that, later that afternoon, defendant unlocked her cell and asked her if she was ready to go. Voorhees testified that when she turned to see if she had left anything in her cell, defendant grabbed her from behind and ordered her to pull down her pants; after she did so, he forced her to kneel and then raped and sodomized her. After defendant left the cell, Voorhees testified that she became nauseous and spit the semen from her mouth into a paper cup which was in her cell. She reported the incident to the matron on duty at the jail later that evening and to the Police Court Judge the next morning at her arraignment. About one hour after she was released, Voorhees went to St. Clare’s Hospital and reported that she had been raped the preceding afternoon. She saved the paper cup she had spit into and gave it to hospital personnel. Tests conducted at the hospital confirmed that the paper cup contained semen and saliva and that there was sperm in the victim’s vaginal area.
Defendant was indicted and charged with first degree rape, first degree sodomy and two counts of official misconduct. After a jury trial, he was found guilty of all charges and was sentenced to two indeterminate terms of 4 to 12 years and two one-year terms, all to run concurrently. This appeal by defendant ensued.
Initially, we reject defendant’s contention that the trial court improperly closed the courtroom during the victim’s testimony. It is apparent from the record that the trial court did not close the courtroom. The press, members of the families of defendant and the victim, Schenectady police officers and members of a rape crisis organization were allowed to remain in the courtroom. The record does not make clear how many people were *496asked to leave, but it does indicate that there were about 28 people who were not lawyers in the courtroom when the People moved to close the courtroom. Thus, the trial court did not deny defendant his right to a public trial (see People v Jones, 47 NY2d 409, cert den 444 US 946), but simply exercised its discretion to maintain order and decorum in the courtroom and protect the rights of parties and witnesses (see Judiciary Law, § 4; People v Hinton, 31 NY2d 71, cert den 410 US 911).
Defendant also contends that the trial court erred in preventing cross-examination of the victim regarding sexual relations she allegedly had with her boyfriend on the night of Friday, September 11, a short time before she was arrested. CPL 60.42 provides that evidence of a victim’s sexual conduct is not admissible except in certain enumerated situations. Defendant relies on the exception which proves that such evidence is admissible if it “rebuts evidence introduced by the people which proves or tends to prove that the accused is the * * * source of semen found in the victim” (CPL 60.42, subd 4). The purpose of this provision is obvious. If the victim had sexual intercourse with an individual other than defendant just prior to or after the alleged rape, evidence of such sexual conduct would be probative and relevant on the issue of whether defendant is the source of semen found in the victim. In the instant case, the People did indeed offer evidence that semen was found in the victim as a result of tests performed at the hospital. However, such evidence had not yet been introduced at the point during the trial when defendant’s attorney sought to cross-examine the victim regarding prior sexual conduct. Thus, the jury had not yet heard any evidence that semen was found in the victim. Had the trial court allowed defense counsel to cross-examine the victim regarding prior sexual conduct at that point in the trial, the only effect of the testimony on the jury would have been an attack on the victim’s character or morals. This is precisely the sort of thing CPL 60.42 was enacted to prevent. Significantly, the trial court specifically offered defendant’s attorney the opportunity to recall the victim if the People offered evidence tending to prove defendant was the source of semen found in the victim. Defense counsel chose not to take advantage of this opportunity.
We also note with regard to this issue that the trial court did eventually admit into evidence the portion of the victim’s hospital record which noted the victim’s admission that she had had sexual intercourse with her boyfriend on Friday, September 11. This was admitted at the proper time, i.e., after the People had introduced evidence that semen was found in the victim.
Defendant challenges the manner in which the prosecutor cross-examined three of defendant’s witnesses. Defendant put *497two witnesses on the stand who testified that the victim had told them that she fabricated the allegations regarding the rape incident. Another witness offered testimony inconsistent with that of the victim regarding the circumstances of her arrest. It is true, as defendant argues, that the prosecutor made a number of technical errors during cross-examination of the witnesses. However, viewing the record as a whole, it cannot be said that such errors warrant reversal.
We reject defendant’s contention that the trial court erred in allowing testimony to bolster the credibility of the victim, since it is apparent that the testimony was properly elicited in response to testimony offered by defendant to discredit the victim’s testimony as a recent fabrication (see People v Williams, 62 AD2d 1026). We have considered the remaining arguments advanced by defendant and find them to be without merit.
Judgment affirmed. Mahoney, P. J., Kane, Main, Mikoll and Levine, JJ., concur.
The charge was dismissed at arraignment.