Fix the issue of header menus flashing