added copying of reader and writer