Changed order of menu and layout initialization