history partially working but the date ranges do not work