Comedian Bill Cosby has won the right to fight his 2018 sexual assault conviction before the Pennsylvania Supreme Court.

The 82-year-old Cosby has been imprisoned in suburban Philadelphia for nearly two years after a jury convicted him of drugging and sexually assaulting a woman in 2004.

He is serving a three- to 10-year sentence.

The Supreme Court has agreed to review two aspects of the case that Cosby’s lawyers challenged on appeal.

The first involves the judge’s decision to let prosecutors call five other accusers and introduce evidence that Cosby had given quaaludes to women in the past.

And the court will examine Cosby’s argument that he had an agreement with a former prosecutor that he would never be charged in the case.

Cosby says he relied on that agreement before agreeing to give evidence in the trial accuser’s civil lawsuit.