fix a problem when num of link >= 4