Fixes crash when trying to get the publicKey