Better network connection check