if links.empty? break