trying to fix a bug involving sort orders