I'm not able to reproduce your issue... confused works for me like expected.
Maybe something got lost on your side in copy-pasting of the code?