considering the priority into task