updated the category sorting