fix average time calculate