Stopping an environmental disaster before it’s too late