A homeless man convicted of bank robbery got his wish to return to prison after a judge sentenced him to 15 years behind bars.

U.S. District Court Judge Robert C. Jones sentenced Tommy Ray McAdoo, 77, to 15 years in prison for holding up a Reno, Nevada, bank with a steak knife and robbing it of $2,000 in 2016, Fox News reported.

McAdoo reportedly admitted to the crime to ensure he would return to prison and get off the streets.

“In large part, Mr. McAdoo simply wanted to get out of the cold and return to prison,” his lawyer said.

His public defenders argued for a lighter sentence of five years or less due to McAdoo’s age and poor health, but their arguments did not convince the judge, who deemed the 77-year-old a threat to the public.

“He has shown a willingness to commit a violent crime in order to obtain a benefit, including government housing,” Judge Jones said.

McAdoo’s criminal history includes at least five different robbery convictions as well as a conviction for assault with intent to murder and rape. He completed his most recent prison term in 2008.