Resolved issue with adding duplicate keys.

Resolved issue with adding duplicate keys to the collection.