__getitem__ exception fix