modify buffer copy