fix pubkey replacing privkey