improved menu handling