bug fix getting min max date range