Add bound checks to friend request functions