error in write out 2D