add priority sorting