final version -update the Connection failure bug