add write xyz functionality to write method in DMA