fix malformed file