merged and fixed comparison of category text