Judgment, Supreme Court, New York County (Herbert J. Adlerberg, J.), entered October 7, 1991, which denied petitioner’s writ of habeas *170corpus seeking his release pursuant to CPL 180.80 on the ground that the indictment had been obtained without affording him an opportunity to testify before the Grand Jury, unanimously affirmed, without costs.
Petitioner was arrested on September 23, 1991 for having sold cocaine to an undercover officer, and arraigned the following day on a felony complaint charging him with third degree sale and possession of a controlled substance. At arraignment, petitioner gave notice of his intention to testify before the Grand Jury, but the Department of Correction failed to produce him on the date set for his testimony, Friday, September 27, 1991. Counsel agreed to waive petitioner’s CPL 180.80 rights until the following Monday, in the expectation that petitioner would then be produced and allowed to testify. On September 30, 1991, the People presented their case to the morning Grand Jury but did not ask for a vote. Petitioner was not produced in the morning, and, due to the security measures necessary for the undercover’s appearance, the case could not be presented to an afternoon Grand Jury. The prosecutor requested a good cause extension under CPL 180.80 (3) until the next day, to allow petitioner to testify, but that application was denied when the court could not ascertain the reason for petitioner’s nonappearance, and the prosecutor proceeded to obtain an indictment before the morning Grand Jury adjourned. Petitioner thereafter brought this writ, claiming that his rights under CPL 180.80 had been violated by reason of an indictment having been obtained without his appearance before the Grand Jury.
The purpose of CPL 180.80 is to ensure that the defendant is not detained beyond the specified time period without a finding of probable cause. While CPL 190.50 grants the defendant the right to appear before the Grand Jury, and petitioner gave valid notice of his intention to do so, the indictment, concededly defective because obtained without petitioner’s appearance, did not violate his CPL 180.80 rights. Petitioner’s remedy lies not in CPL 180.80, but in CPL 210.20 (1) (c) and 210.35 (4), specifically providing for dismissal of the indictment where the defendant has not been afforded his right to testify before the Grand Jury. (See also, CPL 210.45 [9].) This was the appropriate remedy for petitioner to pursue under the circumstances. Concur—Sullivan, J. P., Milonas, Ellerin, Kassal and Smith, JJ.