fix link type detection