Added getByIndex method