retry to wait for network to become available