added test for file writing