bug fix on accumulate