using state to control menu