capture possible IndexError