merge code and add multicast when sign in