moved network connection check to Util file