fix MessageHandler cannot shutdown