problem if the key does not exist fixed