Prevent ArrayIndexOutOfBound