fix for date range query