query works for more grids