fixed calculation error of #of days