add try except in analyze.py