Added detection for what menu item was selected.