corrects undo redo for line