AMSTERDAM, N.Y. (NEWS10) — Montgomery County Sheriff Jeff Smith spent some time behind bars on Friday for a good cause. The sheriff was placed in a makeshift cell at the Amsterdam Walmart.

Community members had the chance to come down and bail him out. All of the money collected will go to the Bernard and Millie Duker Children’s Hospital. Sheriff Smith said being able to raise money for a children’s hospital is personal to him.

“It raises awareness,” he said. “And I actually have some granddaughters that were premature and received medical care, so the value of a children’s hospital, when a family’s in need, is something you can’t put a dollar figure on.”

A Walmart in Gloversville also participated in the fundraiser.