Judgment, Supreme Court, New *713York County (Michael A. Corriero, J.), rendered May 21, 1991, convicting defendant of criminal sale of a controlled substance in the third degree, two counts of criminal possession of a controlled substance in the third degree and criminal possession of a controlled substance in the fourth degree, and sentencing him to concurrent prison terms of 4 Vi to 9 years on the first three counts and 2 to 4 years on the last count, unanimously affirmed.
The trial court did not abuse its discretion in concluding that defendant was competent to proceed to trial. Defendant’s decision not to take counsel’s advice to plead guilty is not, in and of itself, evidence of incompetence (see, People v Dyer, 128 AD2d 719, 720, lv denied 70 NY2d 711). The court ascertained that defendant did not have a history of psychiatric treatment and noted that, having talked with defendant, the latter seemed to understand the nature of the proceedings. During trial, defendant assisted in his own defense by conferring with counsel about taking the witness stand and by telling counsel that he disputed the testimony of a prosecution witness. Under these circumstances, the trial court did not abuse its discretion in refusing to order a psychiatric examination pursuant to CPL 730.30 (see, People v Chisolm, 162 AD2d 267, lv denied 76 NY2d 892).
Nor did the trial court abuse its discretion in closing the courtroom during the testimony of the undercover police officer. A determination, after a hearing, that a police officer is actively engaged in the community as an undercover narcotics agent "is itself a compelling reason for excluding the public from the courtroom” (People v Santos, 154 AD2d 284, 285, lv denied 75 NY2d 817). The undercover testified that his ongoing investigation of a drug gang would "definitely” lead him back to the area of Manhattan where defendant was apprehended. Concur—Sullivan, J. P., Rosenberger, Wallach and Asch, JJ.