A veteran London court clerk caught surfing porn sites during a rape trial said he did so “because he was bored.”

Debasish Majumder, 54, pleaded guilty to a charge of misconduct in public office and five counts of possession of indecent images, the U.K. Daily Mail newspaper reported.

The prosecution alleged Majumder viewed about 30 images between Dec. 9 and 10 during a rape trial. The judge sitting behind him said he noticed the filthy photos as the victim in the case was testifying.

“He said that he watched a lot of internet porn, he said that at work there were moments in his day that were boring and he would surf the net not to get access to sites but to get the titles of sites to use on his home computer and normally sites were blocked,” the paper quoted prosecutor Annabel Darlow as saying.

Police later found evidence of child porn at Majumder’s home, the Mail reported.

He will be sentenced later this month once his medical reports are in.

