fix bug with stat accumulation