update logic of friendships