fix emit doubles
remove gen_server behaviour from writer