added dynamic menu logic