Improved the 'menuController' method

Now it goes up all the hierarchy to find the menuController.