Making notifications popup only when the number of messages changes