Bugfix save newest data

The json to save was set only when the save dialog is opened first time.