added debug output to MessageHandler