fix MasterSlave bugs