bug fixing for grid