Added date query fix