open links only if connected (improved)