adding sort by pid