Change way messages are checked for duplicates