fixing broken files during creation