Fixing a bug in friend search