updated writer code to use new writer API