averaging data fix