fix tictactoe looping issue