remove \n from end of line