properly copy buffer into channel