initial changes for master/slave