fix duplicate keys