Modified the GetGridValue functionality