using another thread in creating temporary file