fixing all kind of grid problems