fix priority sort