Technology can be the source of behavior like sexting — which can get people like Anthony Weiner in trouble — but a new study shows that text messages can have a positive effect on sex, too. According to new research, high school students who talked about condoms or birth control via text were four times as likely to use condoms when having sex.

“Not all technology use is necessarily harmful,” Laura Widman, the study’s lead author, told Reuters Health. “Although prior research and media attention has focused on the risks of technology use — like sexting — we found that adolescents might also use electronic tools to communicate about ways they might promote their sexual health.”

Researchers studied some 176 U.S. high school juniors and seniors; 64 of them were sexually active. More than half of the 64 who were sexually active reported that they did not consistently use condoms during sex, which mirrors the Centers for Disease Control and Prevention's (CDC) numbers. The CDC found that 47 percent of U.S. high school students were sexually active, and 40 percent of them didn’t use a condom the last time. Simply put: Kids don’t use condoms very often.

However, the researchers found that when teenagers talked about condoms or other forms of birth control via texts, they were four times as likely to use them. Technology is an “intermediary” that can change behavior, cyber-privacy expert Mark Rasch told Reuters. “In this case, it seems to be altering it for the good.”

In fact, finding as many avenues to get the word out about safe sex to teenagers is highly important. The CDC found that the number of American students using condoms hit its peak of 60 percent about ten years ago, and it hasn’t improved much since then.

Meanwhile, the CDC also states that there are some 20 million new sexually transmitted diseases (STDs) in the U.S. every year, which costs the health care system up to $16 billion. The youth “shoulder a substantial burden of these infections,” the CDC states. Young people between the ages of 15 and 24 contract chlamydia and gonorrhea at four times the rate of the rest of the population. “We need to do better as a nation,” Laura Kann, an expert in youth risk behaviors at the CDC, told Time. “Far too many kids in this country continue to be infected with HIV and continue to be at risk.”

Kann also points out that public schools, especially those in Alabama, Alaska and Florida, aren’t doing much to teach teens about the importance of condoms. “Schools have competing health issues that they’re asked to deal with, things like tobacco use, bullying, the obesity epidemic,” Kann told Time. “It’s been hard to keep attention focused on HIV and STD prevention. This complacency issue [is not] unique to just youth themselves.”

Condom use and its link to texting should be researched more, Widman believes. She thinks that technology is “another avenue young people have for communicating about difficult or potentially embarrassing topics, including sexual health,” she told Reuters. “We need to understand this much better than we do now.”