fix date range bug