removed extra \n in writing to history