Use non-mutating sort to avoid attribute issues