fixed a bug when saving menus.