avoid crash on empty index