terminate doc