remove leading and trailing whitespaces that occur during carriage returns