fix mangled file