box1, box2 are undefined at this point.
if you do boxes = {}, it would still work.

what you should is 
local box1 = {gird_x=224,grid_y=288},
local box2 = .......

boxes = {box1,box2}
the order of execution matter