Save only when the user presses submit or close

Fix #1036 
hopefully fix #1033