Replaced sort function. Sorting by published field.