separate test case for write