Indiana high school students will be required to learn cardiopulmonary resuscitation under new state legislation signed into law Thursday that gets rid of a provision that had allowed schools to opt out of CPR training.

Indiana began requiring CPR training in schools last year with the waiver provision, which will no longer be allowed after July 1.

Under the 2014 law, students were also required to learn how to use an automated external defibrillator, or AED, a portable device that can detect a life-threatening heart rhythm and shock the heart back to its normal beat.

Less than half of the roughly 326,000 Americans who have a cardiac arrest outside of the hospital each year receive CPR from a bystander, and only about 10 percent survive. Bystander CPR can increase a person’s chances of survival by two- to three-fold.

Indiana joins 21 other states that have passed school CPR requirements: Alabama, Arkansas, Delaware, Georgia, Idaho, Iowa, Louisiana, Maryland, Minnesota, Mississippi, New Jersey, North Carolina, Oklahoma, Rhode Island, Tennessee, Texas, Utah, Vermont, Virginia, Washington and West Virginia.