correction of calculation of number of days