fixed sorting on categories