ui: fixed menu visibility
Safeguard
ui: replaced a pointer with a reference