fixing variable assignment in grid chart