Update friendsctrl.js

Added logic to check for index.