bug fix in collect-data.py