menu bar logic