add register to master function.