bug fix subtracting day from date