add callback to stream copy method