Up to half of children infected with HIV at birth don’t have the necessary immunity to ward off measles, mumps, and rubella, according to new research.

Infectious disease experts say this is a result of years of cautious immunization practices in young HIV patients.

It can, however, be corrected by ensuring that children with HIV have their full course of measles, mumps, and rubella (MMR) vaccinations.

The research, conducted by the National Institutes of Health (NIH) and the U.S. Centers for Disease Control and Prevention (CDC), involved 600 children exposed to HIV in the womb.

Many of those children were born before 1996, when the modern anti-HIV regimen — combined antiretroviral therapy — came into widespread use.

The study’s first author, Dr. George K. Siberry, told Healthline that because the MMR vaccine contains weakened forms of the live viruses, it could sicken people with compromised immune systems.

This has made doctors cautious of using the vaccines, but research has since shown it’s safe for children with HIV, as long as their immune systems are functioning properly.

“Nowadays, almost all children receive effective HIV treatment that keeps their immune systems strong and so they can safely receive MMR. That is the case now for most people in the U.S. who were born with HIV infection,” Siberry said. “In fact, in our study, 95 percent of the children with HIV infection had gotten their two MMR vaccine doses, so that’s good news.”

The results of the study, part of the Pediatric HIV/AIDS Cohort Study, were published in the journal Clinical Infectious Diseases.

Read More: Delaying Vaccinations Is Not OK, Doctors Say »

HIV Treatment First, MMR Vaccine Second

The CDC recommends that all children healthy enough to receive an MMR vaccine get one dose between 12 months and 15 months of age and another between ages 4 and 6 years.

The NIH research found that children with HIV who started combined antiretroviral therapy before receiving their MMR vaccine doses were more likely to have protective levels of antibodies against all three diseases. They were also protected if they had higher levels of CD4+ cells, infection-fighting white blood cells.

Siberry, medical officer in the maternal and pediatric infectious disease branch of NIH’s Eunice Kennedy Shriver National Institute of Child Health and Human Development (NICHD), says that combined antiretroviral therapy does have an effect on MMR immunity, but it doesn’t weaken it.

“On the contrary, we found that the key to getting high rates of immunity in people born with HIV infection is making sure they get MMR shots after they get on good HIV treatment with combined antiretroviral therapy,” he said.

In the study, researchers found that even though almost half of the children were not immune to measles, only 15 percent were susceptible if they received their MMR doses after effective HIV treatment.

The researchers say evidence suggests the two-dose MMR vaccine provides more reliable protection in children with HIV infection if those children are already receiving antiretroviral therapy first.

“This should be yet one more reason to make sure that children with HIV — like all children and even all adults — are up-to-date for MMR and other vaccines,” Siberry said.

Read More: Photos of Children with Measles Can Change Minds of Vaccination Opponents »

Measles Resurgence in the U.S.

Measles, once a deadly and unavoidable infection, was considered eliminated from the United States in 2000, 11 years after measles vaccinations became the norm.

Still, last year there were 23 outbreaks of measles, and five outbreaks involving 183 cases so far in 2015. The majority of this year’s cases stem from an outbreak of measles at a Disney theme park in Southern California.

All of the modern measles outbreaks were linked to clusters of unvaccinated people who were exposed to the virus after a member traveled internationally.

While some people aren’t healthy enough to be vaccinated — like children younger than 6 months old and people undergoing cancer treatments — herd immunity is important in keeping vulnerable people safe.

“We have all heard about outbreaks of measles in the U.S. This is a highly contagious and potentially dangerous infection,” Siberry said. “So it is important to provide the best opportunity for protection through vaccination to children with HIV infection — both for their individual protection and to help prevent infections like measles from spreading through a community.”

Read More: Measles Spreads in California Due to Unvaccinated Children »