Sens. Christopher Coons (l) and Patrick Leahy speak to Department of Homeland Security secretary Janet Napolitano ahead of her testimony before the Judiciary Committee. (Nadya Faulx/MNS)

Sens. Christopher Coons (l) and Patrick Leahy speak to Department of Homeland Security secretary Janet Napolitano ahead of her testimony before the Judiciary Committee. (Nadya Faulx/MNS)

WASHINGTON — U.S. homeland security chief Janet Napolitano said Tuesday that border security loopholes that allowed Boston Marathon bombing suspect Tamerlan Tsarnaev to go unnoticed on a trip to Russia in 2012 would be tightened under the Senate’s new immigration bill.

Testifying before the Senate Judiciary Committee, Napolitano fielded criticism of her department’s oversight in the trip that has raised suspicions in recent days and said the department will “learn lessons from this attack.”

Days after he urged a more thorough look at the “gaps and loopholes“ in the current immigration system before moving ahead with the new bill, Sen. Charles Grassley, R-Iowa, was persistent in questioning Napolitano about how Tsarnaev’s trip failed to raise suspicions.

“Was your department aware of his travels to Russia?” Grassley asked. “And, if you weren’t, the reason.”

Napolitano noted that Tsarnaev’s departure from the U.S. “pinged” the system, but “by the time he returned, all investigations had been, the matter had been closed.”

Grassley pointed out that a misspelling between his identity documents and his Aeroflot airline ticket allowed Tsarnaev to leave the country without raising any flags. Napolitano responded that the new bill “will help with this” by mandating that passports be electronically readable to avoid discrepancies.

“It really does a good job of getting human error to the extent that is exists out of the process,” she said.

The Boston Marathon bombings have unwittingly become the center of the immigration debate. Tsarnaev, 26, killed in a police shootout Friday, and his younger brother Dzhokhar, 19, charged Monday for his connection with the attack, emigrated to the U.S. over a decade ago from the Russian Caucasus. Dzhokhar was a U.S. citizen; Tamerlan was a legal permanent resident.

The attacks remained a prominent focus in the third day of the immigration bill’s hearings.

Sen. Lindsey Graham, R-S.C., raised concerns that Tamerlan’s trip to Russia could indicate a “broader plot” behind the bombings.

In a press conference Monday, the Senate’s “Gang of Eight” member told reporters, “The new way of hitting America is to do it inside.”

Napolitano said that under the bill, a more robust entry/exit visa system coupled with a wide database of biographic information on immigrants and asylum-seekers will better keep track of those coming to the country.

When asked by Sen. Dick Durbin, D-Ill., if she believed the passage of the bill would “make America safer and more secure,” she replied, “Absolutely.”