How to replace ^M symbols