fix mismatch of alternative index and sorting