Added isConnected method