fix storing of grid size