Fix duplicate check