use temp files and temp dir