Added handling for connectivity.