fix bug of time calculation in the end statistics