isConnected instead != null into sendData function