Added checking of connectivity