Changed the interface of writer_init