Fixed issue trying to add duplicate keys