how to check if the menu is opened