A New Jersey man who fell and broke his hip Tuesday while walking to buy a lottery ticket for this week’s historic Mega Millions jackpot turned his bad break into a $1-million consolation prize.

Earl Livingston, 87, was invited to join the hospital staff’s lottery pool with 141 other players after sharing his disappointment over getting injured before he could purchase his own ticket, WCAU-TV reported.

As luck would have it, the pool included a winning $1 million Mega Millions ticket.

“I didn’t believe him when I got here,” Livingston’s niece, Bobbie Mickle, told the station. “I thought he was confused, maybe from pain meds.”

While Livingston will need a hip replacement, he was in high spirits after the win. He thanked hospital staff and wished them a “happy, happy long life,” the station reported.

The Mega Millions’ big prize for matching all six numbers was won in South Carolina, with a jackpot of $1.537 billion.

While the spotlight this week has been on the Mega Millions jackpot, the Powerball prize has also swelled to one of the largest in history, with an estimated value of $750 million.

The Associated Press contributed to this report.