Peter McCray sat in a Cook County courtroom in June after being charged with illegal possession of a prescription painkiller — a felony. He faced up to three years in prison.

He knew he had to pay $1,000 to get out of jail until his case was resolved. But what he didn’t know is that some Cook County judges often deny access to a free court-appointed lawyer, known as a public defender, once bond is posted. McCray got one of those judges.

WBEZ recently went to numerous courtrooms throughout Cook County and saw some judges routinely deny a public defender based on whether a defendant posted bond, a practice that some legal experts said is unconstitutional. This practice can add further financial burdens on cash-strapped defendants and even compromise their access to a fair trial, lawyers and criminal justice advocates said. Judges were advised by Cook County Chief Judge Timothy Evans in 2013 to stop denying public defenders purely on whether a defendant posted bond, but some judges have ignored Evans.

Cook County Judge Annie O’Donnell didn’t ask McCray about his income or dependents. When McCray told O’Donnell he couldn’t afford an attorney, O’Donnell simply said, “Sir, you have bond posted. Be back here July 12th.”

McCray said he didn’t know that posting bond would mean he’d lose out on a public defender. He said he only made about $300 a week and helps support his 14-month-old daughter. He said he worried about being able to pay his phone bill.

“Certain courts just ain’t following the laws like they should. You know?” McCray said. “I think it’s wrong, because there are a lot of people who need it .. that can’t get it.”

McCray and others like him should not be put in a position where they can either get out of jail or have a public defender represent them at trial for free, said Sharlyn Grace, a lawyer with the Chicago Appleseed Fund For Justice, a nonprofit that advocates for reforms in the justice system.

“He shouldn’t be making a choice between staying in jail and having his life destroyed and having access to his constitutionally guaranteed lawyer,” she said. “That’s not a constitutional choice.”

How bond works — or doesn’t

Bond is suppose to guarantee a person continues showing up to court until their case is resolved. It’s an amount of money, determined by a judge, and it’s paid when someone leaves jail as their case works its way through the court system. But as long as a person continues showing up to court, they get the money back — minus the court fees — when the case is resolved.

When a judge denies someone a public defender because they have posted bond, the idea is presumably that if they can afford to pay, then they can afford a lawyer, legal experts said. At the very least, because the money is returned, the bond can be used toward a legal bill.

But in many cases observed by WBEZ, a person didn’t post their own bond. Instead it was posted by friends or family members. In McCray’s case, he said his girlfriend’s uncle paid the $1,000 so he could come home and help take care of his daughter instead of sitting in jail. He said his girlfriend’s uncle expected him to pay the money back.

Calling the court to order

Evans, the county’s top judge, issued an order in 2013 that specifically told judges to ask defendants questions to see if they can afford a lawyer when a public defender is requested. Evans also advised judges that they can’t deny a request for a public defender just because a defendant posted bond.

Evans’ order helped clamp down on the widespread denial of public defenders, Grace said, but the practice continues in some courtrooms. The Chicago Community Bond Fund, a nonprofit organization that helps pay bond for people who can’t afford it, has a list of judges who regularly deny public defenders. The group said it will not post bond for anyone who appears before these judges because it doesn’t want to lose the bond money or make defendants lose out on a public defender.

In recent months, Evans has made major changes to policies surrounding bond in Cook County. Those changes mean fewer people will have to pay to leave jail, and those who do pay will generally pay lower amounts. That could mean fewer people will be denied public defenders based on bond, Grace said. But for those who still post, they risk losing the right to a lawyer they can afford.

WBEZ recently observed courtrooms across Cook County and saw judges behave very differently from courtroom to courtroom. Multiple judges routinely denied public defenders based solely on bond amounts — a direct contradiction to Evans’ advice.

It is unclear how often people are denied a public defender based on bond. Evans’ office refused to provide data that would help identify how often this practice is used.

But other defendants shared similar experiences as McCray.

One man was never asked about his income and wasn’t sent to the public defender despite having zero income. His friend posted his $1,000 bond on his behalf. Another man said he was marginally employed and sleeping on friends’ couches. His father posted his bond, and he also was not sent to the public defender.

Private lawyers fill the gap

When McCray showed up for his second hearing in July, O’Donnell had retired, and sitting in her place was Judge David Navarro.

McCray still didn’t have a lawyer because he said he couldn’t afford one. In fact, he was in even worse financial shape than his last court appearance. He said because of his arrest, he had been temporarily suspended from his job, which involves working with kids.

But sitting in the the courtroom was a bar attorney, a special kind of private attorney who represents defendants in exchange for their bond money.

When Navarro called up McCray’s case, he sent McCray to talk to the bar attorney, who quickly got the case dismissed. McCray walked out of court with the case behind him. But he lost his all of his bond money — $1,000, which comes out to three weeks in pay for McCray.

Using a bar attorney can have its downsides.

In one case observed by WBEZ, a bar attorney asked a man to give him an additional $300 on top of the $1,000 in bond his friend posted for him, because his case would take two court appearances. Judge Geraldine A. D’Souza never asked about the man’s income, but the man said he was self-employed and currently made no money, and he does not know how he will pay back the cash.

In another case, a man refused to sign over his bond money to a bar attorney because it belonged to his uncle. That man is now planning on representing himself, something that rarely goes well for defendants.

For McCray, his entire ordeal has changed how he views the justice system, he said. He said access to a public defender should be a fundamental right for people who can’t afford an attorney.

“They tell you when you are arrested, supposedly your Miranda rights, one will be appointed,” McCray said. “That’s a lie.”