moved tmpdir creation so less happens before it's demise