Fix invalid usage of temporary object in mainmenu json conversion