added more test and fixed some functionalities (master read from slave)