fix order of indices