add content to write command and print error