-Fix when attempting to sort by non-primitive attribute