fixing indicies