cleanup code and call pandoc from workdir