Use tempfile instead of current directory