fixing link handling