If condition AND changed for OR when testing for new ID number

The actual boolean condition checking for different values between the previous ID and the actual being readed, causes fail when just one of the five Id's bytes is equal to its predecessor. Changing boolean condition to OR instead of AND seems to have solved the problem. Example of the problem, these two ID's are considered equal by the if condition:
03 05 A9 E3 18
04 05 0F F9 19
Because of the second byte having same value, the if condition interprets these two IDs as equals.