individual lives assigning function not working

(Datapack is 1.20.1) So I'm trying to make Grian's Last Life server. I made it so when you do /function life:start, it gives every player a random amount of lives from 2 to 6. The scoreboard works and shows that each player has a different, random number of lives, but the title and team joining parts doesn't work. It just makes every player join the team that has the most amount of lives. Random lives choosing function: execute as @a run execute store result score @s Lives run loot spawn ~ ~ ~ loot life:rng execute as @a if score @s Lives matches 2 run function life:_2 execute as @a if score @s Lives matches 3 run function life:_3 execute as @a if score @s Lives matches 4 run function life:_4 execute as @a if score @s Lives matches 5 run function life:_5 execute as @a if score @s Lives matches 6 run function life:_6 Title functions: title @a times 10 60 20 playsound minecraft:entity.lightning_bolt.thunder master @a ~ ~ ~ 100 title @a title ["",{"text":"2","color":"yellow"},{"text":" lives","color":"green"}] execute as @a run team join 2life @s title @a times 10 60 20 playsound minecraft:entity.lightning_bolt.thunder master @a ~ ~ ~ 100 title @a title ["",{"text":"3","color":"green"},{"text":" lives","color":"green"}] execute as @a run team join 3life @s title @a times 10 60 20 playsound minecraft:entity.lightning_bolt.thunder master @a ~ ~ ~ 100 title @a title ["",{"text":"4","color":"dark_green"},{"text":" lives","color":"green"}] execute as @a run team join 4life @s title @a times 10 60 20 playsound minecraft:entity.lightning_bolt.thunder master @a ~ ~ ~ 100 title @a title ["",{"text":"5","color":"dark_green"},{"text":" lives","color":"green"}] execute as @a run team join 5life @s title @a times 10 60 20 playsound minecraft:entity.lightning_bolt.thunder master @a ~ ~ ~ 100 title @a title ["",{"text":"6","color":"dark_green"},{"text":" lives","color":"green"}] execute as @a run team join 6life @s
Continue to help post