A new study says the criminal-background-check system that Arizona police, gun dealers and employers rely on is flawed.

The Arizona Criminal Justice Commission report also says fixing the system could cost as much as $24 million.

The system relies on employees at dozens of agencies around the state to properly enter and track information.

But the study found that too often, the system fails — resulting in missing criminal records and creating large records gaps that can endanger law-enforcement officers and the public.

The report details steps that police, prosecutors and court employees should take to fix the system through a combination of new technology, technical support and training.

The Arizona Republic says a task force of representatives from police departments, courts and counties throughout Arizona compiled the report.