fixed error for indicies