Add a check on the dimension of the data.