bug fix, date comparison