You attempted to use an undo command within a global command. This is not permitted.
Do not use an undo command within a global command.