Add a method to remove the search in undo command

to remove the search in undo command which is added due to controller