detect network connection is available