fix mqtt bugs