Last year, Air Force veteran Nathan Hutsky re-enrolled in ITT Tech to finish his electrical engineering degree.

He had already completed a year, using his GI Bill benefits to pay for tuition. But when the for-profit college abruptly shut down last September, Hutsky realized he had wasted the funds on credits that wouldn't count toward a degree.

But Hutsky could get his benefits back.

The Senate passed a bill Wednesday that would restore GI Bill benefits to those affected by a school closure, like veterans at ITT Tech and Corinthian.

"This is great news," Hutsky told CNNMoney Thursday. "I have been put on hold trying to figure out what to do for school because ITT took a chunk of my GI Bill," he said.

Hutsky, now 28, plans to return to college next year, when both of his kids are in elementary school. He hopes a degree leads to a better paying job.

The legislation, which now goes to President Trump's desk, would also end the 15-year limit on GI Bill benefits, making them available for life.

Hutsky, who left the Air Force in 2012, said this will also make it easier for him to return to school without having to race against an expiration date.

The Post 9/11 GI Bill program can cover the cost of tuition for 36 months, a monthly housing allowance, and up to $1,000 a year for books. The number of months depends on how many years a veteran served.

More than 1 million veterans have taken advantage of the Post 9/11 GI Bill since 2009, according to the Student Veterans of America, which lobbied for the bill.

A large number of veterans enrolled in ITT Tech and Corinthian College, which both heavily recruited students from the military. The two colleges shut down dozens of campuses, suddenly closing their doors to thousands of students, amid a crackdown on the industry from the Obama administration.

For-profit colleges in general have been accused of preying on veterans and low-income students, and making false promises about good jobs upon graduation. But many students at for-profit colleges don't ever finish their degree. They make up about 35% of all federal student loan defaults.

After the schools shut down, many students found their credits wouldn't transfer to other colleges. While students who borrowed federal student loans to attend ITT Tech or Corinthian can apply to have their debt erased, veterans were unable to reuse their GI Bill benefits.

Related: How ITT Tech went up in smoke

The legislation to expand the GI Bill passed with unanimous support in both the House and Senate.

"I'm especially proud of the bipartisan work we've done to pass legislation to expand the education benefits veterans earn through the GI Bill and, for the first time in history, allow them to utilize these benefits throughout their entire lives," said House Veterans' Affairs Committee Chairman Phil Roe in a statement.

It also makes some reservists and Purple Heart recipients eligible for GI Bill benefits regardless of their length of service, as well as provides for additional scholarships for those veterans pursuing a degree in science, technology, engineering or math.