check array index exist.