SUPER easy fix, and just a slight oversight linename = "Row" + linecount++;
to var linename = "Row" + linecount++; this keeps "linename" *local* inside the function.... the way you had it, it was technically "window.linename" that was getting used, hence always showing the last (and last saved) line name