not use tmpfile on detecting