Check for network before http request