workaround for segfault in tree iterator