fix to use query date with specified offset