fix msg.barrier and set.seed