fixing unbalanced \r