Puerto Rico just hit another debt deadline.

At midnight on Monday, a year-long moratorium on lawsuits from the island’s creditors will expire, which many forecasters project might worsen a developing financial catastrophe on the island, as at least a dozen creditors are expected to sue and tie up more territorial funds. Things took a turn for the worst last weekend, when bondholders rejected a restructuring agreement for much of Puerto Rico’s $70 billion debt obligation, but the picture brightened a bit Sunday evening, when Congress signaled it had reached a budget deal to avoid a government showdown that provided almost $300 million in Medicaid funds to the island. Territory officials and a debt restructuring board installed by Congress last year hope the funding will ease some of the pressure as they consider whether to launch into a massive bankruptcy process and increasing austerity measures. Meanwhile, protesters took to the streets in San Juan.

As a consequence of emigration, Puerto Rico is aging rapidly, and more and more of the people left behind on the island are older and sicker or younger and dependent. Doctors are leaving en masse as well. The three predicaments—budget, health, and demographic—in essence form a runaway feedback loop, one that at its most dramatic might end in depopulation, a major public-health emergency, and a fiscal point of no return.

It didn’t have to be this way. In addition to financial mismanagement by officials on the island, mass emigration to the mainland United States, and general financial and employment doldrums on the island, one of the reasons cited by Puerto Rican leaders for the current mountain of debt is a chronic federal underfunding of its Medicaid program, which covers about half of its population.

While states receive a federal matching percentage for every dollar they spend on Medicaid enrollees—a  match rate that is enhanced for enrollees under the Affordable Care Act’s Medicaid expansion and adjusted for the poverty rate in each state—the match rate for Puerto Rico and the other territories is much lower, and there is a global cap on the amount of funds they can receive every year, which was $329 million for Puerto Rico in 2015, good for only 14 percent of total costs that year.

Although the ACA provided Puerto Rico nearly $6 billion in a one-time eight-year allotment in Medicaid and Marketplace funds, even with that addition, the federal government still pays less per enrollee than it does for even the poorest states. That funding will be exhausted this year, which might drop half of the island’s Medicaid population to the ranks of the uninsured.

This limited block grant funding scheme, now considered a potential model for funding Medicaid under various Republican Obamacare repeal plans, was almost destined to fail in Puerto Rico. Not only has the Puerto Rican Medicaid block grant failed to keep up with real health costs, it has lagged further and further behind the expansion of the program in the states under the Affordable Care Act. Their spending increased especially as reforms like the Affordable Care Act added more eligible enrollees with generous federal matching funds, but Puerto Rico’s hard caps remained.

The block-grant structure also illustrates the worst possible scenario for states under the Republican plans: Funding that cuts federal spending by simply not providing enough to sick people, and a health-care infrastructure that cannot adjust or mobilize to fight epidemics.

A 2005 letter from Eduardo Bhatia, then the executive director of the Puerto Rico Federal Affairs Administration, details that constant shortfall. “If the Puerto Rico Medicaid cap enacted at $20 million in 1968 would have grown at the same rate the Medicaid program has grown, the cap today would be about $1.7 billion instead of its current $219 million,” he wrote. “Puerto Rico would not only have a different Medicaid program today, but it would have a different healthcare system.” That was 12 years ago, and even factoring in the yearly one-time Obamacare funding as a yearly injection, current federal funding for Puerto Rico wouldn’t have even met Bhatia’s dream scenario then, let alone meet actual costs today.

The scourge of Zika is also a major burden on the island, especially for the pregnant mothers and young children that are major beneficiary groups under Medicaid. Zika is a major stress on the health-care infrastructure, even as more and more physicians leave, uncompensated care rises, and the budget crisis leaves Puerto Rico struggling to keep the lights on at major hospitals.

The seeds for that disaster were sown into the very fabric of the American safety net. After decades of naked colonial and racist policy following the acquisition of Puerto Rico and the Virgin Islands, the territories were not included in the social-insurance provisions of the Social Security Act of 1935. Their inclusion would not come until 1950, when legislators wrote them into the law, with support from politicians from districts with strong Puerto Rican constituencies like Rep. Vito Marcantonio from East Harlem. “I hope the House will insist on the position of having Puerto Rico included in our social security system,” Marcantonio argued on the House floor. “Not to do so will only mean an intensification of the discrimination that exists against Puerto Rico under the present colonial system.”

Still, the inclusion of the territories came as a second-class package, reducing the disability and dependent insurance to much lower levels than those for the states and establishing hard annual caps for them. When the Social Security Act of 1965 created Medicaid and Medicare, the Medicaid provisions for the territories simply updated the older law’s limits. Even so, while territorial citizens don’t pay federal personal income taxes, they were obligated to pay the major Social Security and Medicare taxes required by the law to fund its major programs.

There’s simply no reason other than that history of exclusion for the serious health-care spending shortfalls that Puerto Rico faces every year. Obamacare was the first major missed opportunity to fix this policy flaw: Although its major one-time funding package was a boon to the territories, it still put them in a position to have to continuously lobby for Medicaid funding, now with a much less friendly Congress.

Also, since Obamacare’s insurance subsidies for purchasing private coverage are provided as refundable tax credits, Puerto Rican residents who might be in a position to purchase private insurance can’t apply for them since they don’t pay income taxes. Medicare advantage payments and the Medicare system in general have invested less for seniors on the island with lower effectiveness, problems that could have been fixed with the last round of health reform.

President Trump definitely doesn’t seem to be the ear the territory seeks in the White House—on Twitter he characterized budgetary funds for Puerto Rico’s Medicaid program as a “bailout,” and seemed to imply that Puerto Ricans were neither his constituents or taxpayers.

But for a president bereft of early policy accomplishments who seems to crave them, there’s a chance now to begin to reverse centuries of exclusionary policy by simply endorsing a plan to treat the people of the territories like the American citizens they are.

For now, if the proposed budget does pass Congress, Puerto Ricans will be granted some relief. But there are no guarantees for the next time, or the next crisis.