fixed grid memcpy bug