Handle error case in distributed mode