fixed race condition in file system