Added isConnected functionality