changed summaryhistoryfromstats to historyByDay