Fix last commit.

We don't know 100% that endline always \n. If user repeatedly open
dialog endline will duplicate.