add error checking for tile click