Update the menu switch function.