With the novel coronavirus wreaking havoc around the globe, just about every nation faces major issues with its food supply. While a potentially devastating food security crisis looms, a food loss crisis has already taken hold.

With supply chains interrupted, many farmers have lost their major markets due to closures. From the U.S. Midwest to India’s countryside, farmers are dumping milk, plowing onions into fields, letting ripe fruit rot, killing piglets and more.

The food loss crisis is not a failure of individuals – not the farmers who work hard to ensure their labor goes toward nourishing people and not those on the other end of the supply chain whose livelihoods hang on ensuring that food makes it to people’s plates.

It’s a systems failure.

The human and economic impacts are only compounded by the environmental effects since food loss and waste cause 8% of annual greenhouse gas emissions.

How we address this emerging food loss crisis now will decide if we’re prepared for the next global emergency. Building a more resilient food system that can weather such a break in the supply chain will require creative thinking from government, food companies, tech leaders and others.

Here are three changes that, if enacted, would help create a resilient global food system:

1. Government Facilitation and Redistribution

Governments have the unique ability to bring important groups together to overcome national, and indeed global, challenges. National governments should orchestrate greater cooperation across the food supply chain, ensuring farmers are working with distributors, food banks, retailers and others to get food where it’s most needed.

In some countries like France, legislation already exists to require retailers donate unsold food to charities. In others, the government steps in to facilitate during unique circumstances.

The U.S. government recently announced a plan to spend $300 million per month on fresh fruit and vegetables, dairy products and meat that would typically go to hospitality businesses and restaurants. These products will instead be distributed to food banks, which face overwhelming demand from millions of people out of work due to the pandemic.

In the short term, the U.S. government’s action uses links across the supply chain to get food where it needs to go, and ensures farmers are paid for their goods and food banks can have stocked shelves. It’s not a permanent fix for the American food system, though.

Governments and funders big and small should also invest in schemes that fund organizations specializing in food’s redistribution.

In the United Kingdom, for example, the environmental non-profit WRAP has announced £3.25 million (about $4 million) to help “micro operations for whom a few thousand pounds will make an enormous difference and bring extra storage, better transport, equipment and so on.”

2. Technologies that Connect Farmers with In-Need Groups

In Kenya, a company called Twiga Foods uses an app to connect 13,000 smallholder farmers to 7,000 vendors, creating an easily accessible marketplace for produce.

In the UK, Tesco uses a technology called FareShare FoodCloud to alert local charities via text message when there is surplus food from a nearby store that can be picked up free of charge.

And across Europe, while most restaurants are closed, many still offer takeout meals. Too Good To Go links consumers across Europe with restaurants offering discount to-go meals, helping ensure prepared food isn’t wasted.

The technologies exist now to scale up connections between farmers and food banks, retailers and consumers so no food goes to waste. What’s needed is investment in these technologies, as well as more widespread awareness of their potential and adoption across the industry.

3. Increased Risk Sharing

A budding business movement has already taken off where retailers commit to purchase foods from growers and ranchers, even if retailers can’t accept full delivery or there’s an issue with a harvest. This stabilizes the supply chain and spreads out risk to make it easier for buyers and sellers to tolerate.

Farmers and ranchers know they will receive a certain percentage of their expected earnings even if there are unforeseen issues, and retailers build strong relationships with producers, spend less time and money on finding and managing many suppliers, and see a reputational benefit as part of building a conscientious business.

When there is food that retailers can’t use, they are also able to help connect growers and with fresh and frozen suppliers so no edible food goes to waste. In the case of a crisis like a pandemic that affects entire parts of the supply chain, apps like the ones mentioned above can help connect producers to entirely new markets so less food is left rotting in fields.

Risk sharing has to also extend to workers, especially informal workers in developing countries. Those without any safety net are the most vulnerable to disruptions in the food system. Informal workers experience a loss of income without any ability to tap government programs.

Governments can help pay a percentage of workers’ wages in times when farmers and producers don’t have much cash coming in. These kinds of emergency programs have already been implemented economy-wide in Denmark and the UK, ensuring workers have some income and the economy avoids a more severe contraction.

Very little about the future of this coronavirus pandemic is known. What is clear is that if the food system doesn’t change, more people will suffer and we will be unprepared when the next global emergency hits. But if leaders act now, what happens during this coronavirus pandemic can help put countries and the global food system on a resilient path where food doesn’t go needlessly to waste.