The Denver Sheriff Department is giving a heroin antidote to high-risk inmates when they leave the city’s two jails.

Inmates who have been addicted to heroin and other opiates are being trained on how to use naloxone nasal spray before they are released, the sheriff’s department said Friday in a news release.

Previously, addicted inmates received a prescription for the drug, which revives people who have overdosed. But those prescriptions were not getting filled, the department said.

The Colorado Office of Behavioral Health spent about $12,000 to buy 500 kits that will be given to jails across the state, the sheriff’s department said.

Every month, the Denver Sheriff Department books dozens of inmates who are addicted to heroin or other opiates. In December, 60 inmates were placed on an opioid withdrawal protocol, the department said.