add calculate duration