fix link handling