added auto saving of editor state.