fix bugs in grids upgrade