make tmpdir configurable
Change tmpdir to @tmpdir