Updated add_missing_endline to set extra line for easy conatenation