do the comparison earlier

so we can report a match/mismatch in the debug messages