adding tmpfile option for speed up