add network detection