fix for submenu appearing after being made inactive