Add connected flag to state