added a fix for \r since the previous commit doesn't solve the problem