Fix keypair creation issue when user change keys credentials