fix segfault on testnet