handle links correctly