recalculate priority