A major concern police have about state laws legalizing marijuana is how to detect when motorists may be driving under the influence of pot — or other drugs. Now, San Diego police are joining a growing number of cities relying on mouth swabs for chemical tests to help detect drivers who are on drugs.

The swabs and two portable testing machines hit the field Friday night in San Diego, reported CBS-8 TV. It’s the second city in the state after Los Angeles to use the new detection method.

The machines test for the presence of marijuana and six other drugs: cocaine, methamphetamine, amphetamine, methadone, opiates and benzodiazepines. The amount of the drug or level of intoxication, however, is not determined in the tests.

Officer demonstrates new roadside drug testing machine @10News pic.twitter.com/SBcSK7kM7l — Jennifer Delacruz (@10NewsJen) March 16, 2017

Law enforcement officials believe the number of impaired drivers are bound to increase with California’s legalization of marijuana. A study by the state’s Office of Traffic Safety found that 38 percent of drivers killed in car crashes in California in 2014 tested positive for drugs, legal or illegal. That was up 6 percent from the previous year.

San Diego began using the Dräger 5000 test after officials met with authorities in Colorado, which legalized marijuana for recreational use in 2014, the San Diego Tribune reported.

Canadian authorities began using similar testing swabs and machines from a different company in a pilot program in late 2016 in the city of YellowKnife, the capital of the country’s Northwest Territories.

“The goal of any of these initiatives is to save people’s lives,” said Royal Canadian Mounted Police Corporal Todd Scaplen. “And if we have further tools to be able to do that, I think it’s very important.”

Swabs with portable testing kits are also being used in New York, Arizona and Nevada, among several other states, as well as in Germany and Belgium, and Australia, notes the Tribune. Other strategies, including breathalyzers that test for drugs and apps to help police test for impairment are also on the market.

Under San Diego guidelines, police will first observe a driver to make an initial determination about possible impairment, and may require a field sobriety test like those administered to suspected drunk drivers. If impairment is suspected, the motorist may then be asked to run a swab inside his or her mouth for as long as four minutes. The swab would then be tested in a portable machine and results would be available in up to eight minutes. For pot, the machine only tests for the presence of the active THC compound that causes a high. A driver can refuse the test, but then an officer can order a blood test.

As states grapple with drugs’ impact on road safety, testing strategies face several challenges. With pot, for example, a swab test might still detect the presence of the active THC compound even days after smoking, when the driver may be perfectly safe behind the wheel. On the other hand, a driver may be impaired by consuming marijuana through edible products that a saliva swab test might not detect.

The next problem states face is determining what level of drugs in a person’s system may result in dangerous driving, similar to the scale they’ve set for blood alcohol content. It’s unknown, however, if marijuana compound blood levels would be as predictive of impairment as blood alcohol levels tend to be.

CORRECTION: An earlier version of this story stated that THC usually stays in the body for a few hours. In fact, THC can stay in the body for weeks and can be detected in saliva for up to 48 hours. Language has also been added to clarify that impairment is not always correlated to whether THC is detectable in an oral test.