added writer thread