sort the priority