Could you add a comment here saying that undoFunction is only set once the entry promise has been resolved