Fixed problems with chosing the right selectedTile from table.