Add delegate for enable undo button