fix the grid bug