update calculation of duration