How does this work without spying on confirm?