correcting line ends