fix a bug when the keyword appeared as the last word
replace "\r" with a space