fix prio_cmp function.