Fixed the bug of duplicated entries.