added test for safewriter