fix toTiles