sleep when disconnected
handle connection error