Fixed a bug in messaging