Check the key exists before adding it