improve algorithm when player change side and join the game