only init writer once