Fixed bug in getting friends from database