added some hacks for choosing need priority