fixed bug where total time was not calculated correctly.