changed calculation of total time to after update