Drugs for anxiety, depression and insomnia could impair driving ability, and may increase the risk of having a car accident, a new study suggests.

Taiwanese researchers compared 5,200 people involved in major auto accidents, with more than 31,000 people with no record of serious accidents. They found people who were involved in car accidents were more likely to have been taking medications, known as psychotropic drugs, for these conditions, HealthDay reports.

“Our findings underscore that people taking these psychotropic drugs should pay increased attention to their driving performance in order to prevent motor vehicle accidents,” lead researcher Hui-Ju Tsai said in a news release. “Doctors and pharmacists should choose safer treatments, provide their patients with accurate information and consider advising them not to drive while taking certain psychotropic medications.”

Previous studies have found an association between some drugs used to treat insomnia and anxiety, such as benzodiazepines, and auto accidents. This study also looked at the effects of antidepressants, antipsychotics, and drugs used to treat insomnia known as “Z-drugs.”

The new study found an association between car crashes and benzodiazepines and antidepressants, but not antipsychotics. The findings suggest that higher doses of medication increase the risk of accidents.

The findings appear in the British Journal of Clinical Pharmacology.