The relator was indicted in Kings county with another person for the crime of a conspiracy to obstruct justice. He pleaded not guilty and was admitted to bail, and a motion subsequently made to dismiss the indictment was denied. The petition states that, prior to the date of the indictment, to wit, on July 10, 1930, the relator executed and acknowledged an alleged waiver of immunity in the action referred to, and that thereafter he testified before the grand jury of Kings county as to the facts relating to the inquiry which resulted in his indictment. The petition of the relator then goes on to state as follows: ‘ ‘ That prior to so testifying, said alleged waiver of immunity, which had been executed by the *132petitioner and acknowledged by him, was not filed in the office of the County Clerk of Kings County, as petitioner has been informed and believes; that your petitioner never directed the filing of the said waiver of immunity in the County Clerk’s office of Kings County. Your petitioner further states that thereafter and on the 5th day of August, 1930, as he has been informed and verily believes, the said waiver of immunity was filed in the office of the County Clerk of Kings County without his consent and without his direction.”
It was further alleged in the petition that the grand jury, by virtue of these facts, had no jurisdiction to indict the relator; that the so-called indictment was void and that the relator was illegally restrained of his liberty, and his claim is set forth in the petition as follows: “ Your petitioner further states that under the provisions of Section 584 of the Penal Law of the State of New York and under the Laws of the State of New York, as well as under the Constitution of the State of New York and of the United States of America, your petitioner became immune from prosecution for the crime' of conspiracy alleged and referred to in this petition, and your petitioner further states that in view of the fact that the petitioner herein was permitted to testify before the Grand Jury, which indicted him, he has, as he has been informed and believes, been granted immunity from prosecution in the said conspiracy action, by reason and by virtue of the facts alleged in this petition.”
The return to the writ set forth that the relator was in custody under an order of the county judge of Kings county, and that the relator had been indicted by the grand jury of Kings county on July 17, 1930, charged with the crime of conspiracy.
The relator traversed the return, annexing to said traverse a copy of the indictment under which he was held.
Appellant claims that, inasmuch as he was permitted to testify before the grand jury in this case, prior to the filing in the office of the county clerk of a waiver of immunity, which had been executed and acknowledged by him, he gained immunity to the extent that he could not be prosecuted for or on account of any transaction, matter or thing concerning which he testified or produced evidence before said grand jury.
Section 584 of the Penal Law (as added by Laws of 1910, chap. 395) reads as follows:
“ Witnesses’ privileges. No person shall, be excused from attending and testifying, or producing any books, papers or other documents before any court, magistrate, or referee, upon any investigation, proceeding or trial, for a violation of any of the provisions of this article, upon the ground or for the reason that the testimony *133or evidence, documentary or otherwise, required of him may tend to convict him of a crime or to subject him to a penalty or for (sic) forfeiture; but no person shall be prosecuted or subjected to any penalty or forfeiture for or on account of any transaction, matter or thing concerning which he may so testify or produce evidence, documentary or otherwise, and no testimony so given or produced shall be received against him upon any criminal investigation, proceeding or trial.”
Subsequently, the Legislature enacted section 2446 of the Penal Law (as added by Laws of 1912, chap. 312), which reads as follows:
“ Waiver of immunity. If it be provided by this chapter or any other general or special law that a person shall not be prosecuted or subjected to any penalty or forfeiture for or on account of any transaction, matter or thing concerning which he may testify or produce evidence, documentary or otherwise, or that testimony so given or produced shall not be received against him upon any criminal investigation, prosecution or proceeding, such person may execute, acknowledge and file in the office of the county clerk a statement expressly waiving such immunity or privilege in respect to any transaction, matter or thing specified in such statement and thereupon the testimony of such person or such evidence in relation to such transaction, matter or thing may be received or produced before any judge or justice, court, tribunal, grand jury or otherwise, and if so received or produced such person shall not be entitled to any immunity or privilege on account of any testimony he may so give or evidence so produced.”
The purpose of this section was to permit defendants to go before the grand jury and testify, upon waiving the immunity provided for by section 584 of the Penal Law. It will be noticed that section 2446 of the Penal Law provides that the person who is to testify may “ execute, acknowledge and file in the office of the county clerk a statement expressly waiving such immunity * * * and thereupon the testimony of such person * * * may be received,” etc.
The sole contention of the appellant upon this appeal is that the statute referred to was not complied with, in that the relator testified before the grand jury before the waiver which he had signed was filed in the office of the county clerk. There is no dispute about this and the appellant contends that the immunity referred to in section 584 of the Penal Law attached to the petitioner as soon as he testified before the grand jury, the alleged waiver not having been filed in the office of the county clerk by him as prescribed by the section referred to; that this is a constitutional right which cannot be taken away from bim by any *134later filing of the waiver. Matter of Rouss (221 N. Y. 81) is referred to, where the Court of Appeals held that section 584 of the Penal Law was designed to give an immunity as broad as the constitutional privilege; that the provisions of the statute amount to a grant of amnesty and that the witness is to have the same protection as if he had received a pardon, and it is argued that, this being so, the relator in effect received a pardon the moment his testimony was taken before the grand jury and that the indictment subsequently found is invalid and void.
The district attorney concedes that the relator testified before the grand jury before his statement waiving immunity was filed with the county clerk as provided by the statute. He maintains, however, in his first point, that the writ of habeas corpus does not lie; that all questions respecting the validity of the indictment must be remitted to the court in which the indictment was found, and that the law does not permit the relator by writ of habeas corpus to interfere with the prescribed legal procedure provided by statute for the determination of the validity and propriety of the indictment. A number of cases are cited by the district attorney upon this proposition. (People ex rel. Burke v. McLaughlin, 77 Misc. 13; affd., 152 App. Div. 912; affd., 207 N. Y. 769; People ex rel. Bullock v. Warden City Prison, 87 Misc. 595; affd., 166 App. Div. 507; affd., 215 N. Y. 172; People ex rel. Moore v. Warden of City Prison, 150 App. Div. 644.)
The principle of these cases is quite familiar. They hold generally that, where an indictment is valid upon its face, the remedy of the person indicted is in the court where the indictment was found; that there is an adequate remedy for every complaint which may be made by a defendant in the established criminal procedure of the State, and that the sufficiency of the indictment and the sufficiency of the evidence before the grand jury to uphold it may not be inquired into in a proceeding upon a writ of habeas corpus. The district attorney refers to sections 313 to 315 of the Code of Criminal Procedure, which provide that an indictment may not be set aside except in the court of arraignment, and it is pointed out that the defendant in the present case was arraigned in the County Court of Kings county. The district attorney also cites People ex rel. Bungart v. Wells (57 App. Div. 140) and People ex rel. Hubert v. Kaiser (150 id. 541; affd., 206 N. Y. 46) where it was held that the writ of habeas corpus is not the process by which to correct errors in the court in which the indictment is pending. Finally, the respondent cites People ex rel. Hummel v. Davy (105 App. Div. 598; affd., 184 N. Y. 30). The relator in that case, under a subpoena, testified before the grand jury, which subsequently *135returned indictments against him and others for conspiracy. This was prior to the enactment of section 584 of the Penal Law. The relator moved to dismiss the indictments on the ground that he had been compelled to become a witness against himself. This motion was denied and he sought to obtain a writ of prohibition enjoining the Supreme Court from proceeding with the trial of the indictments against him. This was denied him on the ground that a writ of prohibition would issue only where the grievance is without redress by ordinary proceedings at law or in equity or by appeal, the court holding that the relator had a right to appeal from the order which denied his motion to dismiss the indictments. I think that that case is not decisive of the question now presented. It does not follow that, because an order of prohibition would be denied, relief through habeas corpus must be denied.
The appellant contends that he is entitled to relief under the writ of habeas corpus for the reason that the material facts before the court are conceded and cannot be changed, qualified or explained. The appellant concedes it to be the fact that ordinarily the writ will not be granted when there is a remedy by appeal; but it is claimed that there is an exception where the facts upon which the writ is sought are unquestioned and where it appears by those facts that a relator is improperly deprived of his liberty. In support of this doctrine, several cases are cited.
In People ex rel. Bullock v. Hayes (166 App. Div. 507, 509) it was said: “ But where, as in the case at bar, the facts before the court cannot be materially changed, qualified or explained, it has been held in rare and exceptional cases that the writ may be resorted to. (People ex rel. Collins v. McLaughlin, 194 N. Y. 556.) * * * Again, even though the question might be raised by a motion in arrest of judgment, this could be only after trial and conviction under the second indictment. (People ex rel. Stabile v. Warden, etc., 202 N. Y. 138, 152.) But if, in the meantime, the accused is unlawfully restrained of his liberty, and the evidence upon this is undisputed, why should he not have resort to this summary remedy? ”
In People ex rel. Collins v. McLaughlin (194 N. Y. 557) the court said: “ The Supreme Court of the United States has recently announced its adherence to this doctrine. In Riggins v. United States (199 U. S. 547, 548), Mr. Chief Justice Fuller states: ‘ Ordinarily the writ will not be granted when there is a remedy by writ of error or appeal, yet in rare and exceptional cases it may be issued, although such remedy exists.’ ”
The appellant also cites People ex rel. Stabile v. Warden, etc. (202 N. Y. 138), where the relator’s right to a writ of habeas corpus *136was upheld by our Court of Appeals. In that case, the relator had been tried and the jury had been discharged, without his consent, and the Court of Appeals held that, as a matter of law, he could not be retried as he had previously been in jeopardy and was entitled to. an absolute discharge. A reading of the opinion, however, shows that the decision rested, in part at least, on the point that he had no right of appeal. In the opinion in the Stabile case, the court refers to People ex rel. Collins v. McLaughlin (194 N. Y. 556), where the court said: “ Except in rare cases where the facts before the court cannot be materially changed, qualified or explained the determination of important issues ought not to be made in a habeas corpus proceeding.”
I am inclined to the opinion that the present case is one of the rare cases referred to in the authorities just cited. The relator cannot at this time appeal from the order denying his motion to dismiss the indictment. This can be done only upon an appeal from a judgment of conviction. (People v. Sexton, 187 N. Y. 495, 511.) It would seem that, if the point he now makes is valid, it would be most unjust to compel him to wait until a judgment of conviction has been entered against him and an appeal taken therefrom by him. I should, therefore, be inclined to the opinion that the writ should be sustained and the relator discharged in this proceeding if the point which he makes were clearly good. But I am of the opinion that it is not. The wording of section 2446 of the Penal Law is peculiar. It provides that, when a person shall execute, acknowledge and file in the office of the county clerk a statement expressly waiving immunity, thereupon the testimony of such person may be received, etc. In the present case the relator did not testify until he had signed and acknowledged a waiver of immunity. Why the statute should provide for the filing of this statement by the relator is not apparent. I cannot see any advantage accruing to him because of such filing. It would seem that the district attorney would be the natural person to have the custody of the statement waiving immunity, and that he should file it, but the statute in question does not so provide. There appears to be no good reason for this provision, and I think we should not construe this statute to mean that the statement of immunity is valueless unless filed with the county clerk by the person making it. The vital thing is the signing and acknowledging of the waiver of immunity before testifying. It seems to me that the requirement of the statute as to filing is of no value to the person making the statement and that a failure to file it does not invalidate the indictment. The relator makes no claim that the waiver was not properly delivered by him. He did not withhold it. Presumably, *137as the district attorney states in his brief, it was delivered to and filed by him. It is also urged by the district attorney that, even if the waiver was of no value unless filed by the relator, he, by testifying after signing the waiver and before filing it, waived the statutory provision with reference to its filing. There seems to be no doubt that a party may waive a rule of law or a statute or even a constitutional provision enacted for his benefit. (People ex rel. Battista v. Christian, 224 App. Div. 243; Matter of Cullinan [Micha Certificate], 76 id. 362.) The district attorney, in arguing that the provision of the statute as to the filing of the waiver should be regarded as merely directory, cites the case of People ex rel. Childs v. Extraordinary Trial Term (228 N. Y. 463), where the relator sought to enjoin a term of the Supreme Court called by the Governor on the ground that the notice of the creation of the court pursuant to the Governor’s proclamation was not published pursuant to the statute, which was the fact. The Court of Appeals, however, held that the provision of the Judiciary Law requiring the Governor to give notice of the creation of an Extraordinary Term of the Supreme Court was merely directory and that the failure to comply with this requirement did not deprive the court of power. (See, also, Dawson v. People, 25 N. Y. 399; People v. Youngs, 151 id. 210.)
My conclusion is that the failure to file the statement waiving immunity, executed by the relator prior to his testifying before the grand jury which indicted him, did not give the relator immunity from prosecution upon the indictment so found. I think the language of section 2446 of the Penal Law as to filing the statement should be regarded as directory only.
The order dismissing the writ of habeas corpus should be affirmed.
Rich and Tompkins, JJ., concur; Lazansky, P. J., concurs with separate opinion; Hagarty, J., dissents, with opinion.