fixed sals inefficient code in socialnetworking