handling links correctly