Fix key already exists bug.

Small bugfix.