fixed error in date_range code