fix priority handling