IndexOutOffRangeException Was Unhandled warning : i have implemented some codes in order to make changes to my csv file. however every time i was the program i the the "IndexOutOfRangeException error.

Any Help would be appreciated as i do not know the solution to this

 
    class Program
    {
        static void Main(string[] args)
        {
            var filePath = Path.Combine(Directory.GetCurrentDirectory(), "kaviaReport 02_08_2016.csv");
            var fileContents = ReadFile(filePath);
            
            foreach (var line in fileContents)
            {
                Console.WriteLine(line);
            }

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }

        public static IList<string> ReadFile(string fileName)
        {
            var results = new List<string>();
            int lineCounter = 0;
            string currentLine = string.Empty;
            var target = File
     .ReadAllLines(fileName);
            //.Skip(1) // Skip the line with column names
            while ((currentLine = fileName) != null)//while there are lines to read
            {
                if (lineCounter != 0)
                {
                    //If it's not the first line
                    var lineElements = currentLine.Split(',');//split your fields into an array
                    lineElements[4] = lineElements[4].Replace(' ', ',');//replace the space in position 4(field 5) of your array
                    //target.WriteAllLines(string.Join(",", fielded));//write the line in the new file
                    File.WriteAllLines(fileName, target);
                }

                lineCounter++;

            }

            return results;
        }
    }
}
