Fix bug where new data was not saved
