NEW YORK (AP) — The New York state court system’s longtime communications chief was fired Thursday after inadvertently telling a reporter that he “barely” went to work at his $166,000-a-year job.

David Bookstaver’s firing came a day after the New York Post reported he unwittingly dialed a reporter’s voicemail, which captured him conversing with someone else — and acknowledging that he was sloughing off at the office.

“I’m not doing anything. I barely show up to work,” Bookstaver said in a part of the recording the newspaper posted online.

The 58-year-old had been planning to retire in October from his communications director job. Instead, he was terminated, chief court spokesman Lucian Chalfen said.

“While there are occasional abuses of office, we take those abuses extremely seriously, and whenever we learn about them, we will always act to hold the offenders accountable,” Chalfen said. He said it was too early to determine whether any disciplinary action could follow.

Bookstaver declined to comment.

He had been with the courts since 1996, after working as a spokesman for New York City’s emergency medical service. Earlier, he was a freelance photographer who did work for The Associated Press in the 1980s.

Bookstaver’s court-system job ranged from explaining metal-detector policy to helping manage media swarms around high-profile cases and fielding questions and complaints about access to courtrooms and records. Priding himself on responding to reporters’ inquiries, he sometimes took calls while out hunting on days off.

But his portfolio shrank after Chalfen became public information director in February 2016, as Chief Judge Janet DiFiore began her tenure and brought him with her.

Still, when the Post asked this week about Bookstaver’s work for a possible news story, Chief Administrative Judge Lawrence Marks said it was simply less visible, not less valuable, according to the paper.

Bookstaver told the paper the same, but the truth was that “they took away all my responsibilities and left my pay,” he dished on the unintentional recording, according to the Post. He went on to say he anticipated an embarrassing Post story but figured he’d just go get his pension.

“I kind of asked for it,” he said, according to the Post. “If you have a big mouth, you know, it catches up with you.”