More than 60% of opioid painkillers prescribed to surgical patients are not used, according to a new study. The researchers say the findings have implications for curbing the opioid epidemic.

The researchers used an automated text messaging system that regularly checked in with more than 900 patients who had undergone orthopedic or urologic procedures. They were asked about their pain and use of opioids prescribed to control the pain.

In the 21 days after surgery, orthopedic patients took an average of six of 20 prescribed opioid pills. Urology patients took an average of one of seven prescribed pills, HealthDay reports.

The study found 64% of patients said they didn’t even use half of their prescription. Just 21% of orthopedic surgery patients and 11% of urology patients asked for a refill a month after their procedure.

“Through simple text messaging, we highlight a method which gives clinicians the information they need to reduce prescribing and manage pain,” study co-author Dr. Anish Agarwal said in a news release.