added generic string writing and fixed the append new fields only case