fixed bug in date range