fix keypair problems