trim newline from end of error messages