fix daily averaging bug