Lookup fails with array index out of bounds, added exception handler