refactor, add save button