fixed some bugs in friend controller