loop in slave & master