modified undo-limit