only the first line runs

the function is run when you get the advancement
Continue to help post