sorting by categories and categories page working