fixed bug in local/remote link detection