While the country was focused this past week on the flag that flies above the South Carolina statehouse, important work was being done inside its doors.

In a major victory for ridesharing, Gov. Nikki Haley has signed a bill creating a permanent regulatory framework for transportation network companies, with real solutions to ensure public safety while at the same time promoting free markets. The measure, H. 3525, also overrides a more restrictive ordinance regulating TNCs in the City of Charleston.

It marks quite a turnaround from five months ago, when the state Public Service Commission issued a cease-and-desist order (rescinded after just two weeks) that Uber must stop operating within the state. It’s a turnaround even from earlier this month, when an earlier version of the bill failed in the state House of Representatives by a 23-81 vote. Uber has been operating on a temporary license that was set to expire June 30, had Haley not signed the bill.

With the deal, TNC frameworks have now passed in nearly two dozen states, marking another sign that we’re finally moving past the debate over whether or not these companies are safe for consumers and fair for drivers. The regulations passed in South Carolina take measures to ensure the companies are safe, while allowing drivers to decide for themselves whether or not the platforms are fair.

The new law requires that drivers must have primary insurance coverage, on their own or through the TNC, that acknowledges they are covered as a TNC driver. The insurance must provide at least $50,000 of per-person liability, $100,000 of per-incident liability and $50,000 of property damage coverage. Drivers also must obtain background checks, cannot be registered sex offenders or can’t have intoxicated driving convictions within the past ten years.

There are other requirements that don’t exactly appear necessary from a safety and consumer protection perspective, but ultimately proved crucial to getting a compromise bill passed. For instance, drivers must display a removable indicator on their car that they are a TNC operator and vehicles must pass a 19-point safety inspection. The bill also requires TNCs to apply for permits with the state‚Äôs Office of Regulatory Staff and drivers who have loans on their cars must tell the loan-holding entity they drive for a TNC.

It’s not perfect, but the good news is that TNC drivers now have a green light in South Carolina.