patch to avoid duplicates