link count bug fix