catch both "\r\n" and "\r" cases