fix sorting to work, and actually keep the change