Added Code to prevent adding the same key and prevent adding the key to the uri multiple times