added the append_line_to_file functionality