Remove the extra pubKey.serialize() that is blowing things up.