NEW YORK (AP) — A former CIA software engineer can represent himself at his upcoming retrial on espionage charges, a judge said Monday.

U.S. District Judge Paul A. Crotty said in a written order that Joshua Schulte had shown that he was sure he wanted to act as his own lawyer.

Schulte, 32, faces an October trial on charges that he leaked CIA secrets to WikiLeaks, which published materials in 2017 that revealed how the CIA hacked Apple and Android smartphones in overseas spying operations and efforts to turn internet-connected televisions into listening devices.

After a year-long investigation, authorities arrested Schulte, who had already left the CIA after falling out with colleagues and supervisors and moved to New York City to work at a news agency. Prior to the move, Schulte had worked as a coder at the agency’s headquarters in Langley, Virginia.

Schulte has pleaded not guilty to charges alleging he made what prosecutors say was the largest leak of classified information in CIA history.

At a hearing last week, Crotty warned Schulte that he may be at a disadvantage because his incarceration without bail will prevent him from doing some things that lawyers might be able to do if they were representing him. To help Schulte, the judge appointed two attorneys as “standby” counsel.

At Schulte’s first trial, a jury deadlocked on espionage charges while convicting him of lesser charges of contempt of court and making false statements.

After the espionage trial, Schulte faces child pornography charges in a separate trial.