fixed bug in reduce