Fix reindexed logic