Your if statement isn't necessarily acting on the same data that's being printed to the Serial Monitor since it uses a second read.
Your if statement isn't necessarily acting on the same data that's being printed to the Serial Monitor since it uses a second read.