update friend function