The son of two retired Chicago police officers is set to receive his sentence on Tuesday for the hacking of personal devices that led to dozens of nude photos of celebrities being leaked online nearly two and a half years ago.

In return for no more than nine months in prison, Edward Majerczyk, 29, pleaded guilty in September to his role in the scandal known as “Celebgate,” which exposed nude pictures of at least 30 celebrities, including actresses Jennifer Lawrence and Kirsten Dunst, and model Kate Upton. The charge, unauthorized access to a protected computer to obtain information, carries a maximum five-year prison sentence.

Majerczyk admitted to illegally obtaining more than 300 victims’ iCloud information between November 2013 and August 2014. The Chicago man did not have the intention of leaking the photos online, instead planning the hack for his personal satisfaction, court documents show.

At the time of the hack, Majerczyk was suffering from depression and looked to pornography websites and online chat rooms to “fill some of the voids and disappointment he was feeling in his life,” his attorneys, Thomas Needham and Colleen Shannon, said.

Majerczyk, who lives with his mother, used fake email addresses designed to look like security accounts from various internet providers to trick victims into giving him their login information.

While he said he primarily targeted celebrities’ iCloud accounts, Majerczyk didn’t originally understand the extent of his crime and began seeing a therapist when he learned others had started distributing the photos online, according to his therapist.

Majerczyk didn’t wish to reclaim his laptop, desktop computer, iPhone and DVD, which the FBI seized after raiding his home as part of their investigation, according to his attorney.

The lifelong Chicago native has expressed remorse for his victims and has no other criminal history, according to court documents.