fixed some bug for functions handling users and friends