not swapping time and endtime