The Pentagon is reviewing the policies and procedures for issuing security clearances to contractors as part of a broader review following the deadly rampage at Washington Navy Yard earlier this week, Defense Secretary Chuck Hagel announced Wednesday.

The Washington Navy Yard, site of Monday’s shooting that left 12 people dead in addition to the gunman. Photo by U.S. Navy.

The review of contractor clearances is part of the overall examination of physical security and access policies at Pentagon facilities, Hagel said.

“Where there are gaps we will close them. Where there are inadequacies we will address them, where there are failures we will correct them,” Hagel told reporters. Hagel’s announcement came after Navy Secretary Ray Mabus said the service would separately review its security posture. Hagel said he is also setting up a panel to conduct an independent investigation in addition to the one he’s ordering.

A 34-year old gunman identified by authorities as Aaron Alexis killed 12 people at Naval Sea Systems Command (NAVSEA) at the Navy Yard base Monday morning before he was shot and killed by law enforcement.

A former sailor, Alexis was about to start at job at NAVSEA as an IT contractor for the Navy Marine Corps Intranet (NMCI). He was employed by The Experts, a subcontractor for prime Hewlett-Packard [HP], the latter said.

Alexis had been cleared to work at NAVSEA and had access to the building, despite having a checkered record while in the Navy from 2007-2011. He reportedly had run-ins with law enforcement years ago over gun- related incidents but was not prosecuted. Several media reports have said he experienced a psychotic episode in August that brought police officers to his residence in Rhode Island.

Hagel said “there were a lot of red flags” regarding Alexis, and the investigation will include looking at how they were overlooked.

“Obviously, something went wrong,” he said.

Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff, said it was unlikely the security lapse at Navy Yard could be attributed to the budget cuts the Pentagon is currently facing.