Six years ago, Uber launched a feature in Saudi Arabia that let women drivers on its ride-hailing app ask to be connected to female riders. Since then, the “women preferences” feature has rolled out to 40 countries, from Argentina and Brazil to Canada, India, and Mexico.

In a few weeks, this feature will finally make its way to the United States, the company said on Wednesday. Uber plans to pilot the feature in Detroit, Los Angeles, and San Francisco.

Women will be able to set a preference for a woman driver in the Uber app, increasing their chances of a match. After that’s done, when a female rider requests a trip, they will see an option called “women drivers.” If the wait is longer than expected, the rider can opt for another ride, according to Uber.

Women drivers can switch their settings to “women rider preference.” This setting can be changed if the driver wants to receive trip requests from all riders.

Ride-hailing companies like Uber and Lyft have grappled with ways to improve safety and attract the broadest set of users — both on the driver and rider sides. But it hasn’t been an easy road.