after adding sorting for categories