fixed tmp dir check/creation