Added tmpdir support