fixed saving bug

added to write object ( need to change this to JSON/GSON stuffs)