fix grid drawing