update switch menu function