fix get link logic