bug fix in MessageHandler.c