Error handling in case of an abrupt disconnect