check if master or slave