fix the bug with i_link_count with link function