handle the case of \r