More resilience in data collection script