date comparison bug fix #2