fixing tileArray problem