fixed going beyond array bounds self.classIndex