improve dma reset code