fixing the ^M issue by removing the 'sed' usage