Work at fixing file race bug