Added undo stack limit