Fixed a problem in the viewFriends function