Fix link creation bug