fixed some issues creating new keys (hopefully)