fixed category_exists()