update the function of adding friends