fixing bug with isConnected bool