change saveData to format f.write as string to fix the TypeError: expected
a character buffer object bug