Working prototype with only isConnected issue