fixed the similarity calculation bug