(CNN) Instead of watching fireworks, some Florida inmates will be cuddling dogs this Fourth of July.

Dogs often get frightened and anxious because of fireworks and other loud noises from July Fourth celebrations. So Brevard County designed a program to comfort the dogs as well as "help add purpose to the lives of inmates incarcerated at the Brevard County Jail."

Inmates on the jail's chain gang and other work crews will read to, play with and give treats to dogs at the Animal Care Center during the peak hours of celebration on Thursday, Sheriff Wayne Ivey said in a statement on Facebook.

"Our goal is to not only help calm the dogs but also to help build and instill a sense of purpose and compassion in the inmates that will hopefully aid them as they transition back into society once the have served their time," Ivey said.