Fixed IndexOutOfBoundsException