corrected bug: end timestamp was not saved in csv file