
46 Ill. App.3d 536 (1977)
361 N.E.2d 105
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
MICHAEL NORRIS, a/k/a David Grill, Defendant-Appellant.
No. 76-142.
Illinois Appellate Court  First District (2nd Division).
Opinion filed March 8, 1977.
*537 James Geis and Victoria J. Meyers, both of State Appellate Defender's Office, of Chicago, for appellant.
Bernard Carey, State's Attorney, of Chicago (Laurence J. Bolon and Myra J. Brown, Assistant State's Attorneys, of counsel), for the People.
Reversed and remanded.
Mr. PRESIDING JUSTICE DOWNING delivered the opinion of the court:
This is an appeal from the denial of a motion by defendant, Michael Norris, to withdraw his plea of guilty and to vacate the judgment entered on the plea. Pursuant to a plea agreement, defendant pleaded guilty to the offense of armed robbery (Ill. Rev. Stat. 1973, ch. 38, par. 18-2) and was sentenced to a term of four to 10 years, plus five years parole. The sentence was in accordance with the State's recommendation, which included concurrent sentences on other pending indictments. Defendant subsequently filed a pro se motion to withdraw the plea, vacate judgment, and request appointment of different counsel. He appeals from the denial of his motion without an evidentiary hearing, raising the following issues for our review: (1) whether the trial court abused its discretion in denying the motion without holding an evidentiary hearing; and (2) whether defendant was denied his right to effective assistance of counsel at the hearing which was conducted.
*538 Before accepting defendant's guilty plea, the trial court informed him that by pleading guilty he was waiving his right to a jury trial or bench trial, his right to confront witnesses, and his right against self-incrimination. Defendant responded that he understood. The trial court also explained the possible sentence and asked defendant if any force or coercion was used to induce the plea, besides the plea agreement. Defendant answered, "No." After the parties stipulated that the court had heard a sufficient factual basis, the trial court accepted the plea, found defendant guilty of armed robbery, and sentenced him. Following the sentencing, the trial court informed defendant of his right to appeal and of the requirement for a written motion requesting vacation of the judgment and withdrawal of the plea within 30 days. The court also told defendant that any claim of error, not included in the motion, would be waived.
Within 30 days defendant filed a pro se motion, setting forth the following allegations: that he is innocent and has an alibi defense; that he did not understand the term "jury waiver" or his right to a jury trial; that he did not understand the term "coercion"; that he was unfairly persuaded to plead guilty because defense counsel failed to develop and explore the possibilities of an alibi defense; that he did not willingly, knowingly, and understandingly plead guilty or waive any rights; and that he did not have a good relationship with his lawyer and the court refused to permit counsel to withdraw and appoint a new attorney. Defendant also filed an "Affidavit in Forma Pauperis and Request for Appeal Counsel" requesting representation by the State Appellate Defender.
Defendant was represented at the post-trial hearing by one of the assistant public defenders who had represented him at the time of the plea. After defense counsel stated that he had read the transcript of the plea proceedings, he said that they would stand on the pro se motion as presented. When the court asked the attorney if he had any argument on the motion, counsel responded:
"I believe the basis of the argument on the motion would be that Mr. Norris did not * * * at the time of the taking of the plea fully understand the rights he had and the rights he was waiving. That he did encounter some difficulty communicating and having a good relationship with his attorneys.
I was one attorney that represented him, Mr. Mikula was the other. I think Mr. Mikula was with him at the time of the plea.
His allegations are that our office or other attorneys did not explain everything clearly enough to him, Judge. I obviously am not going to be a witness against Mr. Norris on his behalf."
Thereupon, the trial court stated that it had read the transcript and would deny the motion to withdraw the plea and vacate judgment. The public *539 defender was appointed again to represent defendant on this appeal. Counsel asked that the State Appellate Defender be appointed because the adequacy of representation offered by the public defender might be advanced as a basis for appeal. The State Appellate Defender was then appointed and now prosecutes the appeal on defendant's behalf.

I.
 1 We note at the outset that the trial court acted properly in accepting defendant's plea of guilty. Following the requirements of Supreme Court Rule 402 (Ill. Rev. Stat. 1973, ch. 110A, par. 402), the court informed defendant of his rights and made a determination of the plea's voluntariness and its factual basis. The court's conduct of the proceedings fulfilled the purpose of the rule; that is, to safeguard a defendant's rights by assuring that a guilty plea is intelligently, understandingly, and voluntarily made. (People v. Ginder (5th Dist. 1975), 26 Ill. App.3d 295, 298, 324 N.E.2d 703; People v. Thurston (1st Dist. 1975), 25 Ill. App.3d 900, 902, 324 N.E.2d 1.) After determining that defendant's decision to plead guilty was an informed decision, the court accepted the plea and told defendant of his right to appeal under Supreme Court Rule 604(d). (Ill. Rev. Stat. 1975, ch. 110A, par. 604(d).) Thus, defendant was informed that if he desired to appeal from the judgment entered upon his plea, he was required to file a written motion stating the grounds within 30 days of the date on which the sentence was imposed. Defendant's timely pro se motion met this requirement. The trial court promptly held a hearing on defendant's motion but denied the motion without hearing evidence.
 2, 3 On appeal defendant contends that the court's refusal to hold an evidentiary hearing was an abuse of discretion; the State contends there was no abuse because evidentiary hearings are not authorized by Rule 604(d). Although we do not agree with defendant's belief that any allegation of error going to the propriety of the plea proceedings automatically mandates an evidentiary hearing, such a hearing may be required in some situations. The rule states that, "When the motion is based on facts that do not appear of record it shall be supported by affidavit." Since the motion may be based on facts outside the record, an evidentiary hearing must necessarily be contemplated where a defendant, by his supporting affidavits, has alleged sufficient facts to challenge the correctness of the plea proceedings. We believe that the evidentiary hearing envisioned by Rule 604(d) is similar in some respects to that conducted pursuant to the Post-Conviction Hearing Act (Ill. Rev. Stat. 1973, ch. 38, par. 122-1 et seq.). That act, however, relates only to constitutional questions not previously raised on direct appeal; and even the post-conviction petitioner is not entitled to an evidentiary hearing as a matter of right. (People v. Farley (1st Dist. 1976), 37 Ill. App.3d 178, 182, *540 345 N.E.2d 724; People v. Meeks (1st Dist. 1975), 31 Ill. App.3d 396, 400, 334 N.E.2d 253.) Similarly, a defendant seeking to withdraw his guilty plea must plead factual allegations demonstrating the need for an evidentiary hearing. There is no automatic right to withdraw a guilty plea.
 4 Defendant also maintains that an evidentiary hearing was required because his attorney at the hearing failed to file the certificate set forth in Rule 604(d):
"The defendant's attorney shall file with the trial court a certificate stating that the attorney has consulted with the defendant either by mail or in person to ascertain his contentions of error in the entry of the plea of guilty, has examined the trial court file and report of proceedings of the plea of guilty, and has made any amendments to the motion necessary for adequate presentation of any defects in those proceedings."
Defendant argues his counsel's failure to file the certificate supports his claim of inadequate assistance of counsel and the need for an evidentiary hearing. The State responds in the alternative: either the certificate requirement does not apply where the same counsel represents defendant at both the plea and withdrawal proceedings; or defendant's attorney substantially complied with the rule because he indicated that he had read the transcript and must have consulted with defendant when he represented defendant in the previous proceeding. We hold that the certificate requirement is applicable in all cases, but that substantial compliance with the rule in some cases is acceptable.
Our decision is consistent with the line of cases holding substantial compliance sufficient under other Supreme Court Rules. For example, the requirement that the attorney for a post-conviction petitioner must show consultation with his client may be fulfilled by substantial compliance. (Ill. Rev. Stat. 1973, ch. 110A, par. 651(c); People v. Drew (1st Dist. 1976), 36 Ill. App.3d 807, 809-10, 345 N.E.2d 45; People v. LeCompte (5th Dist. 1976), 38 Ill. App.3d 513, 515, 347 N.E.2d 797.) The procedure to be followed when a trial court permits a waiver of indictment or counsel may be fulfilled by substantial compliance. (Ill. Rev. Stat. 1973, ch. 110A, par. 401; People v. Budd (2nd Dist. 1975), 29 Ill. App.3d 908, 909-910, 332 N.E.2d 143; cf. People v. Jones (1st Dist. 1976), 36 Ill. App.3d 190, 193, 343 N.E.2d 644.) Although People v. Samuels (5th Dist. 1976), 42 Ill. App.3d 642, 356 N.E.2d 563, suggests that the certificate procedure under Rule 604(d) must be strictly followed, Samuels is distinguishable. There the reviewing court needed the certificate to show what steps had been taken by counsel and what had transpired at the hearing because no transcript of the proceeding had been prepared. The instant case presents no such problem. We believe that Samuels is not controlling and that our task is to *541 determine whether under the facts of this case, defendant's attorney substantially complied with the requirements of Rule 604(d).
 5 The purpose of the Rule 604(d) certificate is to demonstrate that defense counsel has consulted with defendant to ascertain his allegations of error, has examined the necessary files, and has amended the motion where needed. The record before us reflects no consultation between defendant and his attorney. Although the assistant public defender recited the gist of defendant's motion, the attorney made no oral representations whatsoever that he had consulted with defendant. Having failed to consult with his client, the attorney did not even substantially comply with the rule. The attorney's failure to consult with his client or to file the certificate is a crucial issue in the case at bar. Defendant contends that this failure is symptomatic of the attorney's conflict of interest which rendered defendant's representation inadequate.

II.
Defendant was represented at the hearing by one of the two assistant public defenders who had represented him when he entered the guilty plea. As one of defendant's allegations of error concerned his representation earlier, he contends that his counsel could not adequately present his claim due to a conflict of interest. At the hearing on defendant's motion to withdraw his plea of guilty and to vacate the judgment entered thereon, defense counsel alluded to defendant's claim of inadequate representation but stated that he would not be a witness.
 6 In the analagous situation of a post-conviction proceeding, our supreme court has recognized that an inherent conflict of interest confronts the public defender's office when an assistant charges that another assistant incompetently represented the petitioner at trial. (People v. Terry (1970), 46 Ill.2d 75, 78-79, 262 N.E.2d 923; People v. Smith (1967), 37 Ill.2d 622, 624, 230 N.E.2d 169.) There is too great a possibility that the representation will be less than enthusiastic. If the issue of incompetency is adjudged meritorious, it reflects unfavorably upon the integrity of the attorney's own office. (People v. Wallace (5th Dist. 1974), 24 Ill. App.3d 195, 196, 320 N.E.2d 428; People v. Bain (5th Dist. 1974), 24 Ill. App.3d 282, 284, 320 N.E.2d 426; see also People v. Brittain (1972), 52 Ill.2d 91, 284 N.E.2d 632; People v. Boston (1971), 49 Ill.2d 335, 274 N.E.2d 8.) Although an attorney should not argue his own inadequacy or that of his office, he is under a duty to withdraw as counsel when the issue arises.[1] The attorney must withdraw when he learns, or it is obvious that he or one in his office should be called as a witness on behalf of his client. *542 (Illinois Code of Professional Responsibility, DR 5-102(A).) In this case defense counsel stated that he would not be a witness, apparently voicing his recognition of the potential conflict of interest. The assistant public defender should have asked for leave to withdraw and for appointment of new counsel. People v. Benford (1st Dist. 1975), 31 Ill. App.3d 892, 895-96, 335 N.E.2d 106; People v. Dread (1st Dist. 1975), 27 Ill. App.3d 106, 112, 327 N.E.2d 175.
In view of counsel's conflict of interest, the denial of defendant's motion to withdraw his plea and to vacate judgment was erroneous. We remand the cause and direct the trial court to appoint counsel other than the public defender, and to thereafter require such counsel to file the certificate in compliance with Rule 604(d) as a condition precedent to ruling on the motion. (People v. Moore (4th Dist. 1976), 45 Ill. App.3d 570, 359 N.E.2d 1065.) Once the certificate has been filed, the trial court may weigh the motion from the State of the record at that time. If sufficient facts are then alleged in support of defendant's motion, the court should conduct an evidentiary hearing. The record at that time, however, may also reveal that an evidentiary hearing is unnecessary.
In summary, therefore, the judgment of the circuit court of Cook County denying defendant's motion to withdraw his plea of guilty and to vacate the judgment is reversed. The cause is remanded to the trial court with directions to proceed consistent with this opinion.
Reversed and remanded with directions.
STAMOS and PERLIN, JJ., concur.
NOTES
[1]  See Webster, The Public Defender, The Sixth Amendment, and the Code of Professional Responsibility: The Resolution of a Conflict of Interest, 12 Am. Crim. L. Rev. 739 (1975).
