Find menu index dynamically