Updated onSave to save inputted data