fixing the erros in grid.js