Replace state check to CONNECTED from not CONNECTING