Add indexes check to the arrays.