better use of temporary file directory