fixed selection undo error