removing the null char at the end of each line (after the new line char)