checking for network connection