Fix bug when the key already exists