making this writer save for multi-thread access