fixed bug in analysis  script