First, you aren't checking your indicies for valid values (if curX = 0, then curX-1 is -1, not a valid index).
Second, you aren't picking the appropriate tile, you keep setting the value for the currently picked tile. You should set the selected tile's highlight outside of the For-loop and then pick-all to reset, then run the loop, picking the appropriate tile.
How are you referencing the tile to the array indicies?