add network detection.