working on master mode