use add for on.exit
ensure utf-8 input for pandoc