add undo and edit search function in EventHandler