fix bug with temp file path