add the method of callbackHandler to resend data and detect which connection is lost in application