datetime comparisons fixed