fixed undo duplicate lines