added timeout in collect.py