fix issue when couch produces an error.