A recent report from the inspector general concluded that U.S. Citizenship and Immigration Services mishandled thousands of green cards. The Department of Homeland Security has admitted that these green cards are missing and cannot be accounted for.

These missing green cards pose a security risk for American citizens. As the inspector general cautioned in his report: “In the wrong hands, green cards may enable terrorists, criminals, and undocumented aliens to remain in the United States.”

How bad is the damage? The inspector general’s report states that nearly 19,000 cards over the past three years either contained misinformation or were printed twice. In addition, over 200,000 cards reportedly were delivered to the incorrect address or were otherwise reported as not delivered.

But how does such a large failure occur?

The inspector general’s report lays blame on a system that was created to modernize and enhance the way Citizenship and Immigration Services handles immigration requests and petitions.

To this day, Citizenship and Immigration Services primarily relies on paper-based immigration petitions and transactions. But several years ago, in an effort to digitize and reform that slow, outdated process, the Electronic Immigration System was developed so that its records, forms, and transactions could all be accessed online.

Though the electronic system was intended to make digitized records and allow immigrants to complete transactions electronically, it has been plagued by problems since its inception. Essentially, the unsuccessful system is behind schedule, over budget, and has accomplished precious little.

The government has already sunk $1.2 billion into the program, though it was originally estimated to cost $536 million. And for all that money, the program only allows its users to complete two out of 90 transactions online.

Citizenship and Immigration Services is now running an inefficient system comprised of both paper-based and digitized records. This places an enormous burden on the already struggling department, which currently has millions of applications to process. It is within this system that these failures, perhaps unsurprisingly, occurred.

Citizenship and Immigration Services needs to be held accountable for its failure to implement the Electronic Immigration System in an efficient and timely manner.

It is not only costing taxpayers millions of dollars and making it more difficult for law-abiding immigrants to make immigration requests. It is now putting the U.S. at increased risk of fraud, criminality, and potentially even terrorism.

Immigration policy is a priority of the incoming Trump administration, and this should include fixing Citizenship and Immigration Services. Whoever Trump appoints as the next director of Citizenship and Immigration Services, Congress should hold his or her feet to the fire to clean up this broken system.