remove trailing newline from user input