Added error checking for end of line indicator