concurrect access to buf tmp file fix