check for network before loading