fix for keypair bug