fixed a keypair bug