fix some bugs, now it can stable statistic and push results to database