make sort key actually sort

discovered looking into https://github.com/dimagi/commcare-hq/pull/4214