fixed write bug where append was not appending