catch IndexOutOfBounds; work around #52