added sorting option to categories