Added the menu handler for the function menu