fixed accumulation error