res work, regardless of writeHeader, write