isConnected implemented in different way.