Fix x,y bug when changing board size