fix bug in grid submit script