fix grid bug