Hurricane Harvey has reportedly done billions of dollars in damage to homes and businesses along the Texas coastline. But when the water recedes, many will be left footing the bill for their own repair work because around 80% of Texas homeowners don't have the right kind of flood insurance.

According to the Consumer Federation of America, eight out of ten Houston-area residents with flood damage don't have the right kind of homeowners insurance — the type that covers catastrophic damage from flooding.

Their policies may cover "hurricane damage," but that doesn't always include what insurance companies refer to as "secondary effects" of a natural disaster: damage that comes not from the wind and rain directly, but that follows, including extreme water levels.

For a homeowner in Texas to claim damage from flooding, for example, they'd have to prove that water entered their house not because the water levels rose around them and the water flowed in naturally, but because wind or rain caused damage, like a broken window or hole in the roof, that then let floodwaters in.

It's a loophole that could mean Houston residents will shell out as much as $28 billion to fix water-damaged homes. Areas in and around Houston received nearly 50 inches of rain from Hurricane Harvey, and in some places rain is still falling, as now-Tropical Depression Harvey moves back into the Gulf and makes a second landfall. Homes and businesses are literally underwater and could be for some time, as creeks and rivers recede back to normal levels.

To get coverage for this kind of catastrophic flooding, though, Houston homeowners would have had to purchase insurance through the National Flood Insurance Program. But only around 17% of Houston homes are in federally designated flood plains, where NFIP insurance is required by law. Many homeowners who should have insurance often reject NFIP policies because, despite the government subsidies they carry, the policies are still very expensive.

And, it turns out, NFIP might not be able to pay out much anyway.

NFIP gives people who move into flood plains a guarantee that the government will help them rebuild when their property inevitably sustains water damage. For a while, the plan worked: the NFIP took in more from homeowner premiums than it paid out in losses. But then, in 2007, Hurricane Katrina hit New Orleans, which is situated below sea level, and the program paid out more than $18 billion, wiping out NFIP's holdings. Sandy took an additional $10 billion. By 2016, the NFIP was so far in debt — $25 billion — that the federal government considered shutting down the program altogether.

Of course, the program is up for reauthorization next month.