Fixed a bug in message passing