set connected on error and check disconnected to unsubscribe on jsonchan.