added check on service to calculate the duration