handle \r chars