grid generation fix