file writing debug