fixed segfault in index tool