bug fix for saving in distributed mode