Added method for getting index of item in menu.