it is possible to check existence of file before creating the thread