This is an appeal- from an order denying defendant’s application for a writ of error coram nobis after a hearing.
The facts as developed on the hearing are as follows: In January, 1954, the Grand Jury in Erie County indicted the defendant for violation of subdivision 5-a of section 1897 of the Penal Law charging that on December 7, 1953 in the town of Hamburg, the defendant feloniously possessed and carried a loaded revolver. On January 18, 1954, he was brought into County Court in Erie County for arraignment. The following-incidents at the time of arraignment on that day took place in the following sequence: defendant stood before the Bench and the indictment was read to him; the court then asked the defendant if he had counsel and the defendant answered, “No ”; the court asked the defendant if he had funds with which to employ counsel and defendant replied that he had not; the court then asked him if he desired that the court appoint counsel and he replied, “ Yes ”, whereupon the court stated he would appoint counsel; the court then asked him how he pled and he replied “Not guilty ”. The court thereafter and *353on the same day assigned Attorney George Trimper as counsel. On January 25,1954 Mr. Trimper was released from the assignment and Attorney Paul Adema was assigned in his place. Mr. Adema thereafter conferred with defendant at the jail. On March 9, 1954 the indictment was transferred to Supreme Court, and on that same day the defendant accompanied by his assigned counsel appeared in Supreme Court, withdrew his former plea of not guilty and pleaded guilty. He was sentenced in Supreme Court on March 12, his assigned counsel appearing with him.
The defendant contends upon this appeal that because of his having been called upon to plead to the indictment on January 18, 1954 prior to the assignment of counsel and therefore without opportunity to consult with counsel prior to pleading not guilty, that he was thereupon deprived of substantial rights sufficient to void the judgment of conviction.
The defendant in answer to the indictment may either move to set the same aside or he may demur or plead thereto (Code Crim. Pro., § 312). The motion to set aside the indictment upon grounds set forth in section 313 of the Code of Criminal Procedure must be heard at the time of the arraignment unless for good cause the court postpones the hearing to another time. If such a motion be made and denied, the defendant must immediately answer the indictment either by demurring or pleading thereto (Code Crim. Pro., § 316). The demurrer must be put in either at the time of the arraignment or at such other time as may be allowed for that purpose (Code Crim. Pro., § 322).
When the defendant here, after requesting that counsel be assigned, was called upon to plead to the indictment prior to the assignment of counsel and without opportunity to advise with his assigned counsel, it cannot be said that he was accorded his right to counsel at every stage of the proceedings. He was for the time being at least, even though he pleaded not guilty, deprived of the opportunity to advise with counsel as to whether he should move against the indictment or demur thereto before pleading. However, when after conferring with his assigned counsel he appeared in court with such counsel on March 9 he could have moved to withdraw his plea of not guilty in order that he might move against the indictment or demur thereto. The court possessed the discretionary power to permit him to do so (People v. Doyle, 11 App. Div. 447; People ex rel. Hubert v. Kaiser, 150 App. Div. 541, affd. 206 N. Y. 46). There would seem to be little doubt that such an application would have been granted. However, neither defendant nor his counsel asked *354for any such relief but on the contrary moved to be allowed to withdraw his plea of not guilty and to enter a plea of guilty thereby conceding the validity of the indictment. Even now on this appeal no question is raised as to the validity of the indictment.
While the procedure followed in this case resulted in depriving the defendant of Ms right to confer with assigned counsel before making answer to the indictment, we think the error was cured when later, after conferring with such assigned counsel, defendant appeared with his counsel in court, withdrew his plea of not guilty, took no steps to move against the indictment or demur thereto, but pleaded guilty. In any event his acts from the time he first advised with assigned counsel to and including the proceedings upon the day of sentence are in our view sufficient to support an inference that he understandingly and competently waived his right to advise with assigned counsel prior to his original plea of not guilty. In the circumstances here present the conclusion is inescapable that counsel was assigned in ample time to permit the defendant to take advantage of every opportunity and defense which was originally available to him (see Canizio v. New York, 327 U. S. 82; People v. Markowitz, 119 App. Div. 841, affd. 189 N. Y. 562).
The recent case of People v. Marincic (2 N Y 2d 181) does not, as we read it, indicate a contrary result. In that case two 16-year old girls were arrested and arraigned upon a charge of petit larceny. The court advised them of their right to counsel and followed such advice immediately with the question, “ How do you plead? ”, whereupon the defendants, unlike the defendant in this ease, pleaded guilty. An ill-advised guilty plea even if withdrawn might rise to plague them upon a trial (see People v. Steinmetz, 240 N. Y. 411). Unlike the present case no counsel was ever assigned to the Marincic case and the young defendants in that case never had the advice of counsel at any stage of the proceedings.
We conclude that the order appealed from should be affirmed.