fix issue #1739, hiding of nested submenus