resolve tmpDir correctly