fix a NullPointer bug in accumulator