switching the indexes back to the correct ones