
85 Ill. App.3d 679 (1980)
407 N.E.2d 215
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
ELLIS PARTEE, Defendant-Appellant.
No. 79-90.
Illinois Appellate Court  Third District.
Opinion filed July 8, 1980.
Kenneth A. Grnacek, of Joliet, for appellant.
Edward F. Petka, State's Attorney, of Joliet (John X. Breslin and Kenneth A. Wilhelm, both of State's Attorneys Appellate Service Commission, of counsel), for the People.
Reversed and remanded.
Mr. JUSTICE STENGEL delivered the opinion of the court:
*680 Defendant Ellis Partee appeals from the dismissal of his petition under the Post-Conviction Hearing Act (Ill. Rev. Stat. 1979, ch. 38, par. 122-1 et seq.).
Partee was convicted of two separate armed robberies following jury trials and received two concurrent sentences of 8 to 15 years imprisonment. On direct appeal this court affirmed the convictions and sentences, rejecting defendant's sole argument, that the sentences were excessive. People v. Partee (1975), 29 Ill. App.3d 423, 331 N.E.2d 111.
Subsequently, on November 9, 1976, defendant filed in the trial court a pro se post-conviction petition along with a motion for appointment of counsel and an affidavit in support of the motion. The petition alleged that appointed counsel on direct appeal was incompetent; that, over defendant's objections, only his sentence was appealed, and that various errors had been committed at trial. The court appointed Attorney Charles Hahn to represent defendant in connection with his post-conviction petition. After reading the record and consulting with defendant, Hahn filed a motion to withdraw the pro se post-conviction petition without prejudice on December 27, 1976. In a letter to defendant dated the following day, Hahn told defendant the motion was filed as agreed. The letter also indicated Hahn's intention to investigate the matter further. On December 30, 1976, the motion was allowed.
At this point the record becomes rather confusing. On July 5, 1977, a letter from defendant to Hahn dated January 24, 1977, was filed in the trial court along with materials concerning a Federal civil suit defendant had brought against officials of the Pontiac Correctional Center under 42 U.S.C. § 1983 (1976). The suit involved alleged mistreatment of defendant at the prison. In the letter defendant stated he was sending the material so that Hahn could "get an understanding of * * * what I need help with."
The next item in the record is the following entry in the docket sheet dated February 2, 1978:
"Petition filed. Attorney Charles Hahn appointed to represent the petitioner * * *."
On February 6, 1978, more materials concerning defendant's Federal civil suit against correctional officials were filed. A docket sheet entry of the same date indicates that the letter and papers captioned "In the U.S. District Court" were returned to defendant with the suggestion that he forward them to that court.
On May 4, 1978, a letter from defendant to a judge of the circuit court was filed. The letter requested action on defendant's petitions under the Post-Conviction Hearing Act and for habeas corpus. Shortly thereafter a hearing was conducted. Hahn appeared on behalf of defendant who was not present. At the hearing the trial judge described the letter he received from defendant seeking action on his petitions. The court expressed some *681 confusion about the February 2, 1978, docket sheet entry indicating that a petition was filed, and that Hahn was appointed to represent defendant. Said the court:
"I don't know of anything that was pending except that I must have had something from [defendant] to bring the matter up."
Hahn informed the court that he wrote defendant a letter on February 28, 1978, asking him to explain what action he wanted taken. According to Hahn, defendant's letter in reply had nothing to do with the petition for post-conviction relief. Said Hahn:
"All it said was that he knew I had withdrawn it without prejudice as per our agreement * * *; because I explained to him that a post-conviction couldn't give him relief from incompetency of his public defender on appellate level * * *."
The court indicated it had no record of a petition for habeas corpus or a petition under the Post-Conviction Hearing Act other than the one that had been withdrawn. Hahn replied that he did not know of any other post-conviction petition. Shortly thereafter the following colloquy occurred:
"THE COURT: * * * [H]as [defendant] ever given you any information which would enable you to file a post-conviction in this court regarding the deprivation of constitutional rights at the trial court level?
MR. HAHN: None.
THE COURT: Was his case appealed?
MR. HAHN: Yes, it was.
*   *   *
THE COURT: And his conviction was sustained?
MR. HAHN: Yes, it was."
After Hahn described the original pro se petition, the court stated:
"[I]t is clear to me that [defendant] simply doesn't have anything to raise with this court."
The court then terminated Hahn's appointment and ordered "the pending post-conviction petition" dismissed without prejudice.
On June 13, 1978, defendant filed another pro se petition under the Post-Conviction Hearing Act. It referred to the first petition withdrawn without prejudice and to defendant's repeated requests to the court to reinstate the petition "along the lines appointed counsel had suggested," which requests resulted in the second dismissal without prejudice. It incorporated the allegations of the first petition, alleged incompetence of appointed counsel on direct appeal, and requested the appointment of Attorney Lawrence Begun. The court directed the State to find out if Begun would accept the appointment. The court held a hearing on June 28, 1978, at which only the State was represented. Assistant State's *682 Attorney Badger informed the court that Begun said he represented defendant in a Federal civil suit but did not wish to accept the appointment because he did not practice criminal law. The court asked Badger if the new petition set forth any grounds for relief, and she replied:
"It doesn't really, Judge. * * * He had mailed the petition to the Court seeking a post-conviction relief before. He is saying * * * that the conviction resulted from a substantial denial of his constitutional rights as guaranteed under the 14th amendment. However, he doesn't specify what those denials of his constitutional rights were * * *."
The court then ordered the petition dismissed with prejudice, finding that:
"Ellis Partee has been given sufficient opportunity and legal counsel for the purpose of finding and alleging grounds for relief under post-conviction and has not done so."
In his appeal from that order, defendant makes several arguments, but we need consider only one. He contends he was denied his statutory right to the assistance of counsel with his most recent post-conviction petition. We agree.
Section 122-4 of the Code of Criminal Procedure of 1963 provides, in part:
"If the petitioner is without counsel and alleges that he is without means to procure counsel, he shall state whether or not he wishes counsel to be appointed to represent him. If appointment of counsel is so requested, the court shall appoint counsel if satisfied that the petitioner has no means to procure counsel." Ill. Rev. Stat. 1979, ch. 38, par. 122-4.
In People v. Dye (1971), 50 Ill.2d 49, 277 N.E.2d 133, the trial court dismissed the defendant's post-conviction petition on the State's motion without inquiring as to the defendant's indigence or appointing counsel for him. The State sought to defend this action by pointing out that the petition neither requested such appointment nor alleged indigence. The supreme court observed that an entry finding the defendant indigent and appointing counsel on direct appeal appeared on the same docket sheet as the dismissal of the petition, and that the defendant had been incarcerated since the date of that entry. Under those circumstances, the supreme court concluded, the trial court should have appointed counsel, or, at least, ascertained that the defendant did not desire counsel. See also People v. Williams (1975), 25 Ill. App.3d 1047, 324 N.E.2d 243.
 1, 2 In the instant case, upon being informed that Begun declined the appointment, the trial court should have appointed other counsel or, at least, determined that defendant did not desire other counsel. The docket *683 sheet entries reflecting Hahn's previous appointments as well as defendant's petition itself showed his indigence. If a waiver of the statutory right to counsel is not effected by a petition which is silent on the matter, it cannot be waived by a petition which requests the appointment of a specific attorney who subsequently declines the appointment.
The State argues, however, that any error in this regard was harmless. It cites People v. Polansky (1968), 39 Ill.2d 84, 233 N.E.2d 374, for the proposition that the legislative purpose of section 122-4 is to provide a means whereby a petitioner with meritorious post-conviction claims will have the assistance of counsel in drafting a legally sufficient petition. Since at the May 10, 1978, hearing Hahn told the court that defendant's first pro se petition could not be amended to state a basis for relief, and since the latest pro se petition contains no allegations different from those in the first, the State argues, the purpose of the statute, to provide legal assistance to petitioners with meritorious claims, would not be furthered by appointment of counsel in the instant case.
 3 We disagree. It is true that at the hearing on May 10, 1978, Hahn represented that defendant had not provided him with information with which he could amend the first pro se petition to set forth a basis for relief. Whether facts have come to light since that hearing which would justify post-conviction relief, we have no way of knowing. From the record before us, we cannot determine that counsel would have been unable to prepare a legally sufficient petition. We believe it noteworthy that section 122-4 is phrased in mandatory terms. It provides that the court "shall" appoint counsel if requested by an indigent defendant. We cannot conclude the failure to appoint counsel, or, at least, to ascertain that defendant did not desire counsel was a harmless error.
 4 Whether to permit withdrawal of a petition prior to entry of judgment is a matter for the trial court's discretion. (Ill. Rev. Stat. 1979, ch. 38, par. 122-5.) Having exercised its discretion to permit withdrawal of defendant's first petition, the trial court could not properly dismiss the subsequent petition without following section 122-4.
For the reasons stated above, the order of the Circuit Court of Will County is reversed and the cause remanded for proceedings consistent with this opinion. We believe it appropriate to note that an attorney appointed on remand would be under no duty to advance specious claims of constitutional deprivation. People v. Potcher (1978), 62 Ill. App.3d 910, 379 N.E.2d 1291.
Reversed and remanded.
ALLOY, P.J., and STOUDER, J., concur.
