filesave method changed to json