fixed another bug in the date comparison