The U.S. Environmental Protection Agency is installing a barrier and valve inside an inactive Colorado mine to prevent another surge of toxic wastewater like a 2015 blowout that contaminated rivers in three states.

The 12-inch valve will regulate wastewater pouring from the Gold King Mine in the San Juan Mountains of southwestern Colorado, where the EPA inadvertently triggered a wastewater spill while excavating at the mine entrance in August 2015.

That spill released 3 million gallons of wastewater containing aluminum, iron and other heavy metals and instantly became a major embarrassment for the EPA. Rivers in Colorado, New Mexico and Utah were tainted.

The EPA hasn’t said how much the barrier will cost. The agency didn’t immediately respond to a phone call and emails Wednesday.