fixed a bug where the total time was not being calculated properly.