improve menu handling