handle links more carefully