...well, this is just speculation, but maybe it has something to do with this mess:

if (turn > 4) {
if(board[1][1] == "x"){
if (board[1][2] == "x"){
...