better condition in Category search method