fix writeSeries