Update collect_categories.py

bug fixed and remove extra dependece