Fix IndexOutBoundException