clean invalid file