Some people addicted to heroin are asking judges to lock them up so they can get access to treatment for opioid addiction, NPR reports.

In Massachusetts, some people addicted to opioids are using a law designed for family members to commit loved ones to a locked facility if they are deemed to be a danger to themselves or others because of substance use. Thirty-eight states allow civil commitment for substance abuse, the article notes.

About 8,000 people in Massachusetts will be committed to substance abuse treatment this year, up 40 percent from five years ago. In many cases, people are assigned to a privately run treatment center. If there is no room at private centers, some men are assigned to a program at the state prison. Women committed to mandatory treatment in civil proceedings in the state only go to privately run centers.