added test for writing references without appending