substitute the length of the grid data when the data is reloaded