changed link detection algorithm