improve search_categories source handling