let the thread rest to allow file to be completely written