Finished isConnected method, has not yet been tested