Automatically close the menu