The main problem I can see is that all the switcheroo stuff for player data you do with the activation of groups, it is running every tick, trigger once fair enough, but it can run before the AJAX on read event is true so you could be swapping blank data around before there is any data there. You should trigger the fin>score checks after AJAX on completed.