fix bug in lambda allreduce