Taking 529 withdrawal to pay student loan yr after student has graduated

Son graduated in 2023. He has one a small loan left, due to resume payment in 2024. Because his sibling and cousin didn't use all of their 529 funds, there's enough to pay the loan off.  Doing so will be just under his $10k limit counting a prior loan payoff from 529.  QUESTION: Do we have to make the payment THIS YEAR . . . 2023 . . . to be able to use the 529 money AND to make it a tax free distribution? Today, while working on his 2023 draft taxes, I entered the 529 withdrawal he used for loan payoff early in 2023. It subsequently things like: is/was he is a student in 2023, working on a degree, full or part time, etc.  The answer is yes for 2023, but won't be for 2024 since he graduated.  Do I need to hurry and get out the last loan money while it's still 2023 so it can be a tax-free distribution to pay off a loan?  Thank you for any help!!