when writer.Stop, stop writeloop as well