fix error when submenu is not present