Fix menu visibility state bug