adding keypair reading
fixing private public key reading incorrectly