Fixed the date comparison