fix link detection