preventing duplicate keys in keys array.