Fix the bug that count duplicate GMs