added test for writing mode