Fix a bug that the same message may be sent multiple times