better link detection