bug fix in grid indexes