fixed iissue of invalid messages