sort UIDs