Allowing specially trained pharmacists to prescribe medication to treat opioid use disorder (OUD) can greatly increase rates of continued care, a new study finds.

Researchers studied the effect of a Rhode Island law that permits specially trained pharmacists to prescribe the OUD medication buprenorphine. The study included 100 patients who received buprenorphine at a pharmacy. After they were stabilized, 58 received further care either through the pharmacy or in a clinic or doctor’s office. After one month, 89% of patients who received the medication at a pharmacy were still receiving care, compared with 17% of those who had switched to a doctor or clinic, HealthDay reports.

“To have so many people in the pharmacy group continue on with their care was completely unexpected,” principal researcher Traci Green said in a news release. “The results from this pilot study show how pharmacies can be an effective and viable pathway to treatment for opioid use disorder.”