Fixed OutOfBoundException error