Added functionality to resume data collection from where it left the last time