fixed bug in message parser