Fixed bug with message buffer