shared code extracted, alert on empty menu