strip trailing carriage returns