fixed sorting on category state