The Secret Service currently polls as the worst place to work in the federal government, as mistakes and disciplinary issues have become bigger and more public. It’s been clear that changes needed to be made.

Last week Secret Service Director Joseph P. Clancy announced his decision to resign from the agency. Clancy was appointed in 2014 by former President Barack Obama, despite recommendations made by a Department of Homeland Security panel that pushed for a director from outside of the agency.

With Clancy’s announcement to step down comes the opportunity for the Trump administration to take the recommendation from the DHS panel and appoint a new director from outside the agency in order to combat the backsliding that the Secret Service has experienced in recent years.

The agency has been in the news repeatedly in the past few years for public failures, including the 2012 fiasco involving Obama’s advance team that engaged in sexual conduct with prostitutes ahead of the president’s visit to Colombia.

Other public failures that highlighted the lack of discipline within the agency include an incident involving drunken agents driving a government vehicle into barricades outside of the White House. There was also another incident when an advance agent drank excessively and ended up passing out in the hallway of a hotel in Amsterdam just one day before Obama’s arrival.

Following the Amsterdam incident, in 2014, Secret Service agents were unaware of the fact that an armed private security contractor with a criminal record was in the same elevator as Obama. Just days later a fence jumper was able to run into the inner rooms of the White House before being taken down by an off-duty agent.

These disciplinary issues and failures that have captured media attention in recent years are the product of deeper issues that are plaguing the Secret Service.

The agency is understaffed, which has caused problems related to the training schedules of agents. The DHS panel called for agents to spend 25 percent of their time on-duty in training, the so-called fourth shift. This shift ensures that agents are continually up to date on the latest training, but due to the shortage of agents it is not possible to make sure that agents have sufficient time to complete training while also keeping on-duty hours and receiving time off.

In light of such failures, it should come as no shock that low morale has plagued the Secret Service in recent years. Many agents and officers have stressed the fact that leadership and accountability is currently missing from the agency and needs to be addressed through an “honest top-to-bottom reassessment.”

In order to have such an honest assessment of the agency, the new director should be someone from outside who can look objectively at the problems and be willing to make difficult calls to get the agency back on the right track.

An important task for whoever the new director is will be to bring accountability to the agency, to hold every agent to a non-negotiable standard of behavior.

By creating strong accountability throughout the agency, the large-scale scandals like those we have seen in recent years should go away. Then the Secret Service will be able to fulfill its “zero-failure” mission of keeping the president and other prominent leaders safe.