Added function to fixed malformed csv