only save the document after the terminal step if pepper.keepTerminalDocs is set to "true"