Made changes to isConnected