Added key-exist check