fix tr string end with \n