added new sort by to include priority